Skip to content

ext/pgsql, ext/pdo_pgsql: Remove preprocessor guards for symbols predating libpq 10#21384

Merged
devnexen merged 1 commit intophp:masterfrom
KentarouTakeda:pgsql-remove-obsolete-libpq-guards
Mar 8, 2026
Merged

ext/pgsql, ext/pdo_pgsql: Remove preprocessor guards for symbols predating libpq 10#21384
devnexen merged 1 commit intophp:masterfrom
KentarouTakeda:pgsql-remove-obsolete-libpq-guards

Conversation

@KentarouTakeda
Copy link
Contributor

While working on php/doc-en#5409 to clean up outdated PostgreSQL version notes in the documentation, I noticed that the source code also retains #ifdef guards for symbols guaranteed to exist in libpq >= 10.0 (the minimum enforced in build/php.m4 via PQencryptPasswordConn).

Removed guards (all confirmed in PostgreSQL 10 documentation):

  • PG_DIAG_{INTERNAL_POSITION,INTERNAL_QUERY}: libpq 8.0+
  • PG_DIAG_{SCHEMA,TABLE,COLUMN,DATATYPE,CONSTRAINT}_NAME: libpq 9.3+
  • PG_DIAG_SEVERITY_NONLOCALIZED: libpq 9.6+
  • CONNECTION_SSL_STARTUP: libpq 8.0+
  • CONNECTION_CONSUME: libpq 10.0+

Refs:

…ating libpq 10

While working on php/doc-en#5409 to clean up outdated PostgreSQL
version notes in the documentation, I noticed that the source code
also retains #ifdef guards for symbols guaranteed to exist in
libpq >= 10.0 (the minimum enforced in build/php.m4 via
PQencryptPasswordConn).

Removed guards (all confirmed in PostgreSQL 10 documentation):

- `PG_DIAG_{INTERNAL_POSITION,INTERNAL_QUERY}`: libpq 8.0+
- `PG_DIAG_{SCHEMA,TABLE,COLUMN,DATATYPE,CONSTRAINT}_NAME`: libpq 9.3+
- `PG_DIAG_SEVERITY_NONLOCALIZED`: libpq 9.6+
- `CONNECTION_SSL_STARTUP`: libpq 8.0+
- `CONNECTION_CONSUME`: libpq 10.0+

Refs:
- https://www.postgresql.org/docs/10/libpq-exec.html#LIBPQ-PQRESULTERRORFIELD
- https://www.postgresql.org/docs/10/libpq-connect.html#LIBPQ-PQCONNECTSTARTPARAMS
- https://github.com/php/php-src/blob/53e31d58834ef04375dae7bdc549d73dae371c5a/build/php.m4#L1927
@devnexen devnexen merged commit c56e8ca into php:master Mar 8, 2026
19 checks passed
@KentarouTakeda KentarouTakeda deleted the pgsql-remove-obsolete-libpq-guards branch March 8, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants