ext/pgsql, ext/pdo_pgsql: Remove preprocessor guards for symbols predating libpq 10#21384
Merged
devnexen merged 1 commit intophp:masterfrom Mar 8, 2026
Merged
Conversation
…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
approved these changes
Mar 8, 2026
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
php-src/build/php.m4
Line 1927 in 53e31d5