FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

The identifier case mode of the control file reaches EXEC_BACKEND children (Windows) by Muzzammil242 · Pull Request #2332 · IvorySQL/IvorySQL · GitHub

Repository navigation

The identifier case mode of the control file reaches EXEC_BACKEND children (Windows) - #2332

Open
Muzzammil242 wants to merge 1 commit into
IvorySQL:masterfrom
Muzzammil242:fix/case-mode-exec-backend
Open

Muzzammil242 wants to merge 1 commit into
IvorySQL:masterfrom
Muzzammil242:fix/case-mode-exec-backend

Conversation

Muzzammil242 commented Oct 8, 2026 •
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown

What

initdb -C stores the identifier case mode in pg_control, and at startup SetCaseGucOption() sets ivorysql.identifier_case_switch from it with PGC_S_DEFAULT. Only the postmaster runs that code. On Linux every backend inherits the postmaster's memory, so it does not matter. Under EXEC_BACKEND (Windows) a child process starts from the compiled defaults and reads back the postmaster's non-default variables, and a variable set with PGC_S_DEFAULT is not among them (write_nondefault_variables() skips that source). So on Windows every backend ran in interchange mode whatever initdb -C had said.

Evidence, on a windows-2022 runner

Cluster made with initdb -C normal, connections to the Oracle port and the PostgreSQL port (https://github.com/Muzzammil242/IvorySQL/actions/runs/37853137231):

show ivorysql.identifier_case_switch    -> interchange   (both ports)
CREATE DATABASE "f_quoted_ora"          -> F_QUOTED_ORA  (Oracle port)
CREATE DATABASE "g_quoted_pg"           -> g_quoted_pg   (PostgreSQL port)

That is why the Oracle-mode regression suites fail every test on Windows (#2320 series): the driver's CREATE DATABASE "regression" over the Oracle port creates REGRESSION, and the tests then find no regression.

With this change, same runner, same commands (https://github.com/Muzzammil242/IvorySQL/actions/runs/37854194953):

show ivorysql.identifier_case_switch    -> normal        (both ports)
CREATE DATABASE "f_quoted_ora"          -> f_quoted_ora
"psql" -X -q -c "CREATE DATABASE \"h_system_path\" ..." via cmd.exe /c, as the driver runs it -> h_system_path

Change

The value is a default computed at startup, so SetCaseGucOption() sets it with PGC_S_DYNAMIC_DEFAULT: the postmaster then writes it to the non-default variables file and the children read it back. The precedence against postgresql.conf and SET is unchanged. Nine lines, three of them a comment.

Summary by CodeRabbit

  • Bug Fixes
    • The identifier case setting now uses the configured compatibility mode as its default in NORMAL, INTERCHANGE, and LOWERCASE modes.

…ldren

initdb -C stores the identifier case mode in pg_control, and at startup
SetCaseGucOption sets ivorysql.identifier_case_switch from it with
PGC_S_DEFAULT. Only the postmaster ran that code. On Linux every backend
inherits the postmaster's memory, so it did not matter; under
EXEC_BACKEND a child process starts from the compiled defaults and reads
back the postmaster's non-default variables, and a variable set with
PGC_S_DEFAULT is not among them. On Windows every backend therefore ran
in interchange mode whatever initdb -C had said: "show
ivorysql.identifier_case_switch" answered interchange on a cluster made
with -C normal, and a quoted lower-case name such as the regression
driver's CREATE DATABASE "regression" came out as REGRESSION on the
Oracle port, which is why the Oracle-mode test suites on Windows found
no database and failed every test.

The value is a default computed at startup, so it is set with
PGC_S_DYNAMIC_DEFAULT: the postmaster then writes it to the non-default
variables file and the children read it back. The precedence against
postgresql.conf and SET is unchanged.

coderabbitai Bot commented Oct 8, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info ⚙️ Run configuration
  • Configuration used: Repository: IvorySQL/IvorySQL/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c22b0d8b-f43c-4494-af7d-9036562affc7
📥 Commits

Reviewing files that changed from the base of the PR and between 069766e and 9739f87.

📒 Files selected for processing (1)
  • src/backend/access/transam/xlog.c

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The NORMAL, INTERCHANGE, and LOWERCASE Oracle compatibility modes now set ivorysql.identifier_case_switch with PGC_S_DYNAMIC_DEFAULT instead of PGC_S_DEFAULT. A comment describes the control-file-derived startup default and its handling for EXEC_BACKEND child processes.

Changes

Identifier Case Startup Default

Layer / File(s) Summary
Dynamic default for identifier case
src/backend/access/transam/xlog.c
The NORMAL, INTERCHANGE, and LOWERCASE cases assign ivorysql.identifier_case_switch with PGC_S_DYNAMIC_DEFAULT. A comment describes the control-file-derived startup default and EXEC_BACKEND child handling.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9739f

The control-file-derived identifier setting now reaches EXEC_BACKEND children, while explicit configuration and session overrides retain precedence. No actionable merge risk is established.

🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Check skipped - CodeRabbit’s high-level summary is enabled.
Title check The title accurately describes the main change: propagating the control-file identifier case mode to Windows EXEC_BACKEND child processes.
Docstring Coverage Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Author

The suites, with this change: on Windows (MSVC, meson) together with #2321 and the meson registration of the Oracle-mode suites (new PR), the PL/iSQL suite passes 22 of 22, the core Oracle suite 250 of 258 and the extension suite 26 of 31 (https://github.com/Muzzammil242/IvorySQL/actions/runs/37855437140); without it every test of the three suites failed, because the driver's quoted regression came out as REGRESSION. The remaining thirteen are platform differences (collation, unicode width, xml, time zone names, file paths). Linux is unchanged: all three suites green.

Copy link
Copy Markdown
Collaborator

Thanks for the contribution; using PGC_S_DYNAMIC_DEFAULT appropriately propagates the control-file case mode to EXEC_BACKEND children, and a regression test covering all three modes would strengthen this fix.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL