Skip to content

Commit 5f1a920

Browse files
ext/pgsql: Update outdated PostgreSQL version requirements (#5409)
## Summary The pgsql extension documentation references PostgreSQL versions that have been outdated for years. The requirements page (`reference/pgsql/setup.xml`) states: https://www.php.net/manual/en/pgsql.requirements.php > To use PostgreSQL support, you need PostgreSQL 6.5 or later, > PostgreSQL 8.0 or later to enable all PostgreSQL module features. However, the actual minimum libpq versions enforced by php-src are: | PHP version | Minimum libpq | Commit | |---|---|---| | PHP 8.0+ | libpq 9.1 | php/php-src@ce668c0ec6 | | PHP 8.4+ | libpq 10.0 | php/php-src#14628 | The "PostgreSQL 6.5" requirement has been incorrect since at least PHP 8.0.0 (released 2020-11-26), which requires libpq 9.1 via `PQlibVersion` check in `ext/pgsql/config.m4`. As of PHP 8.4, the minimum was further raised to libpq 10.0 via `PQencryptPasswordConn` check in `build/php.m4`. ## Changes - **setup.xml**: Update requirements to match php-src, following the same pattern used by ext/curl and ext/openssl (per-PHP-version listing). - **14 function pages**: Remove notes referencing PostgreSQL versions 6.3–9.0 that are no longer relevant given the libpq 10.0 minimum. These include version-gated notes for `pg_prepare`, `pg_query_params`, `pg_execute`, `pg_escape_string`, `pg_escape_identifier`, `pg_escape_literal`, `pg_client_encoding`, `pg_unescape_bytea`, `pg_result_error_field`, `pg_parameter_status`, `pg_lo_create`, `pg_version`, `pg_affected_rows`, and the general `reference.xml`.
1 parent 1786db6 commit 5f1a920

15 files changed

+21
-76
lines changed

reference/pgsql/functions/pg-affected-rows.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
queries.
2121
</para>
2222
<para>
23-
Since PostgreSQL 9.0 and above, the server returns the number of
24-
SELECTed rows. Older PostgreSQL return 0 for SELECT.
23+
The server also returns the number of SELECTed rows.
2524
</para>
2625
<note>
2726
<para>

reference/pgsql/functions/pg-client-encoding.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
</para>
2525
<note>
2626
<para>
27-
This function requires PostgreSQL 7.0 or
28-
higher. If libpq is compiled without multibyte encoding support,
27+
If libpq is compiled without multibyte encoding support,
2928
<function>pg_client_encoding</function> always returns
3029
<literal>SQL_ASCII</literal>. Supported encoding depends on PostgreSQL
3130
version. Refer to the PostgreSQL Documentation supported encodings.

reference/pgsql/functions/pg-escape-identifier.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
type fields, <function>pg_escape_bytea</function> must be used
3030
instead.
3131
</para>
32-
<note>
33-
<para>
34-
This function has internal escape code and can also be used with
35-
PostgreSQL 8.4 or less.
36-
</para>
37-
</note>
3832
</refsect1>
3933

4034
<refsect1 role="parameters">

reference/pgsql/functions/pg-escape-literal.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
instead. For escaping identifiers (e.g. table, field
2828
names), <function>pg_escape_identifier</function> must be used.
2929
</para>
30-
<note>
31-
<para>
32-
This function has internal escape code and can also be used with
33-
PostgreSQL 8.4 or less.
34-
</para>
35-
</note>
3630
</refsect1>
3731

3832
<refsect1 role="parameters">

reference/pgsql/functions/pg-escape-string.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
instead. <function>pg_escape_identifier</function> must be used to
2828
escape identifiers (e.g. table names, field names)
2929
</para>
30-
<note>
31-
<para>
32-
This function requires PostgreSQL 7.2 or later.
33-
</para>
34-
</note>
3530
</refsect1>
3631

3732
<refsect1 role="parameters">

reference/pgsql/functions/pg-execute.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
query string. This feature allows commands that will be used repeatedly to
2727
be parsed and planned just once, rather than each time they are executed.
2828
The statement must have been prepared previously in the current session.
29-
<function>pg_execute</function> is supported only against PostgreSQL 7.4 or
30-
higher connections; it will fail when using earlier versions.
3129
</para>
3230
<para>
3331
The parameters are identical to <function>pg_query_params</function>, except that the name of a

reference/pgsql/functions/pg-lo-create.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222
<function>pg_lo_create</function> creates a large
2323
object and returns the <varname>OID</varname> of the large
2424
object. PostgreSQL access modes
25-
<constant>INV_READ</constant>, <constant>INV_WRITE</constant>, and
26-
<constant>INV_ARCHIVE</constant> are not supported, the
27-
object is created always with both read and write
28-
access. <constant>INV_ARCHIVE</constant> has been removed from PostgreSQL itself
29-
(version 6.3 and above).
25+
<constant>INV_READ</constant> and <constant>INV_WRITE</constant>
26+
are not supported, the object is created always with both read and write
27+
access.
3028
</para>
3129
<para>
3230
To use the large object interface, it is necessary to
@@ -60,9 +58,7 @@
6058
<para>
6159
If an <parameter>object_id</parameter> is given the function
6260
will try to create a large object with this id, else a free
63-
object id is assigned by the server. The parameter
64-
relies on functionality that first
65-
appeared in PostgreSQL 8.1.
61+
object id is assigned by the server.
6662
</para>
6763
</listitem>
6864
</varlistentry>

reference/pgsql/functions/pg-parameter-status.xml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,14 @@
2323
parameter if known, or &false; if the parameter is not known.
2424
</para>
2525
<para>
26-
Parameters reported as of PostgreSQL 8.0 include <literal>server_version</literal>,
27-
<literal>server_encoding</literal>, <literal>client_encoding</literal>,
28-
<literal>is_superuser</literal>, <literal>session_authorization</literal>,
26+
Parameters reported by the server include <literal>server_version</literal>,
27+
<literal>server_encoding</literal>, <literal>client_encoding</literal>,
28+
<literal>is_superuser</literal>, <literal>session_authorization</literal>,
2929
<literal>DateStyle</literal>, <literal>TimeZone</literal>, and <literal>integer_datetimes</literal>.
30-
(<literal>server_encoding</literal>, <literal>TimeZone</literal>, and
31-
<literal>integer_datetimes</literal> were not reported by releases before 8.0.) Note that
32-
<literal>server_version</literal>, <literal>server_encoding</literal> and <literal>integer_datetimes</literal>
30+
Note that
31+
<literal>server_version</literal>, <literal>server_encoding</literal> and <literal>integer_datetimes</literal>
3332
cannot change after PostgreSQL startup.
3433
</para>
35-
<para>
36-
PostgreSQL 7.3 or lower servers do not report parameter settings,
37-
<function>pg_parameter_status</function>
38-
includes logic to obtain values for <literal>server_version</literal> and
39-
<literal>client_encoding</literal>
40-
anyway. Applications are encouraged to use <function>pg_parameter_status</function> rather than ad
41-
hoc code to determine these values.
42-
</para>
43-
<caution>
44-
<para>
45-
On a pre-7.4
46-
PostgreSQL server, changing <literal>client_encoding</literal> via <literal>SET</literal> after connection startup will
47-
not be reflected by <function>pg_parameter_status</function>.
48-
</para>
49-
</caution>
5034
</refsect1>
5135

5236
<refsect1 role="parameters">

reference/pgsql/functions/pg-prepare.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
<function>pg_execute</function> or <function>pg_send_execute</function>.
2424
This feature allows commands that will be used repeatedly to
2525
be parsed and planned just once, rather than each time they are executed.
26-
<function>pg_prepare</function> is supported only against PostgreSQL 7.4 or
27-
higher connections; it will fail when using earlier versions.
2826
</para>
2927
<para>
3028
The function creates a prepared statement named <parameter>stmtname</parameter> from the <parameter>query</parameter>

reference/pgsql/functions/pg-query-params.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
<function>pg_query_params</function> is like <function>pg_query</function>,
2424
but offers additional functionality: parameter
2525
values can be specified separately from the command string proper.
26-
<function>pg_query_params</function> is supported only against PostgreSQL 7.4 or
27-
higher connections; it will fail when using earlier versions.
2826
</para>
2927
<para>
3028
If parameters are used, they are referred to in the

0 commit comments

Comments
 (0)