Skip to content

v18+ fixes and compiler warning fix#85

Open
devrimgunduz wants to merge 2 commits into
enova:masterfrom
devrimgunduz:master
Open

v18+ fixes and compiler warning fix#85
devrimgunduz wants to merge 2 commits into
enova:masterfrom
devrimgunduz:master

Conversation

@devrimgunduz

Copy link
Copy Markdown

PG 18 and 19 fixes & fix compiler warning

* AT_CheckNotNull was silently merged into AT_SetNotNull as of PostgreSQL 18
  (commit 14e87ffa0f, "Make NOT NULL constraints implicit from column
  definition proper constraints").  The existing guard only excluded PG < 12,
  so the case label compiled against PG 12–17 but broke on PG 18+ with:

      error: use of undeclared identifier 'AT_CheckNotNull'
      error: duplicate case value 'AT_SetNotNull'

  Narrow the guard to PG 12–17 only: >= 120000 && < 180000.

Affected versions: PG 18, PG 19 (and any future major release)
Fix: tighten the preprocessor guard on AT_CheckNotNull in ddl_deparse.c

* pgl_ddl_deploy_debug_query_string is used exclusively within
  pgl_ddl_deploy.c and was never intended to be exported.  Declaring
  it without 'static' triggers -Wmissing-variable-declarations, which
  is enabled in PostgreSQL's default CFLAGS and treated as a warning
  (not an error) but is noisy and wrong on principle.

  Mark the variable 'static' to give it internal linkage, matching its
  actual usage and silencing the warning cleanly.

Coded by Claude, tested by me.

Per pgdg-packaging/pgdg-rpms#213

* AT_CheckNotNull was silently merged into AT_SetNotNull as of PostgreSQL 18
  (commit 14e87ffa0f, "Make NOT NULL constraints implicit from column
  definition proper constraints").  The existing guard only excluded PG < 12,
  so the case label compiled against PG 12–17 but broke on PG 18+ with:

      error: use of undeclared identifier 'AT_CheckNotNull'
      error: duplicate case value 'AT_SetNotNull'

  Narrow the guard to PG 12–17 only: >= 120000 && < 180000.

Affected versions: PG 18, PG 19 (and any future major release)
Fix: tighten the preprocessor guard on AT_CheckNotNull in ddl_deparse.c
* pgl_ddl_deploy_debug_query_string is used exclusively within
  pgl_ddl_deploy.c and was never intended to be exported.  Declaring
  it without 'static' triggers -Wmissing-variable-declarations, which
  is enabled in PostgreSQL's default CFLAGS and treated as a warning
  (not an error) but is noisy and wrong on principle.

  Mark the variable 'static' to give it internal linkage, matching its
  actual usage and silencing the warning cleanly.

Coded by Claude, tested by me.
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.

1 participant