From ddd685b716dafb9629555621cc9677914f787f2f Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 6 Feb 2026 14:50:22 +0100 Subject: [PATCH 1/2] Add documentation for 5 new pgsql functions Add documentation pages for pgsql functions available since PHP 8.4: - pg_jit: Returns JIT information of the PostgreSQL server - pg_change_password: Change a PostgreSQL user password - pg_put_copy_data: Send data during a COPY operation - pg_put_copy_end: Signal completion of a COPY operation - pg_socket_poll: Poll a connection socket for read/write readiness --- .../pgsql/functions/pg-change-password.xml | 90 +++++++++++++++ reference/pgsql/functions/pg-jit.xml | 70 ++++++++++++ .../pgsql/functions/pg-put-copy-data.xml | 85 ++++++++++++++ reference/pgsql/functions/pg-put-copy-end.xml | 83 ++++++++++++++ reference/pgsql/functions/pg-socket-poll.xml | 108 ++++++++++++++++++ 5 files changed, 436 insertions(+) create mode 100644 reference/pgsql/functions/pg-change-password.xml create mode 100644 reference/pgsql/functions/pg-jit.xml create mode 100644 reference/pgsql/functions/pg-put-copy-data.xml create mode 100644 reference/pgsql/functions/pg-put-copy-end.xml create mode 100644 reference/pgsql/functions/pg-socket-poll.xml diff --git a/reference/pgsql/functions/pg-change-password.xml b/reference/pgsql/functions/pg-change-password.xml new file mode 100644 index 000000000000..0fc62072eb5a --- /dev/null +++ b/reference/pgsql/functions/pg-change-password.xml @@ -0,0 +1,90 @@ + + + + pg_change_password + Change a PostgreSQL user's password + + + + &reftitle.description; + + boolpg_change_password + PgSql\Connectionconnection + stringuser + stringpassword + + + pg_change_password changes the password of a + PostgreSQL user. This function uses the + PQchangePassword libpq function which handles + password encryption automatically based on the server's settings. + + + + + &reftitle.parameters; + + + + connection + + &pgsql.parameter.connection; + + + + user + + + The name of the PostgreSQL user whose password to change. + + + + + password + + + The new password. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + pg_connect + + + + + + diff --git a/reference/pgsql/functions/pg-jit.xml b/reference/pgsql/functions/pg-jit.xml new file mode 100644 index 000000000000..115bd8197950 --- /dev/null +++ b/reference/pgsql/functions/pg-jit.xml @@ -0,0 +1,70 @@ + + + + pg_jit + Returns the JIT information of the server + + + + &reftitle.description; + + arraypg_jit + PgSql\Connectionnullconnection&null; + + + pg_jit returns an array with the JIT (Just-In-Time + compilation) information of the PostgreSQL server. + + + + + &reftitle.parameters; + + + + connection + + &pgsql.parameter.connection-with-nullable-default; + + + + + + + + &reftitle.returnvalues; + + Returns an &array; containing the JIT information of the server. + + + + + &reftitle.seealso; + + + pg_version + + + + + + diff --git a/reference/pgsql/functions/pg-put-copy-data.xml b/reference/pgsql/functions/pg-put-copy-data.xml new file mode 100644 index 000000000000..bb3d9e874976 --- /dev/null +++ b/reference/pgsql/functions/pg-put-copy-data.xml @@ -0,0 +1,85 @@ + + + + pg_put_copy_data + Send data to the server during a COPY operation + + + + &reftitle.description; + + intpg_put_copy_data + PgSql\Connectionconnection + stringcmd + + + Sends data to the server during a COPY FROM STDIN + operation. A COPY command must have been issued + via pg_query before calling this function. + + + + + &reftitle.parameters; + + + + connection + + &pgsql.parameter.connection; + + + + cmd + + + The data to send to the server. A final newline is automatically + added if not present. The data must be formatted according to + the COPY command's format. + + + + + + + + + &reftitle.returnvalues; + + Returns 1 on success, 0 if the + data could not be queued (only in non-blocking mode), or + -1 on error. + + + + + &reftitle.seealso; + + + pg_put_copy_end + pg_query + + + + + + diff --git a/reference/pgsql/functions/pg-put-copy-end.xml b/reference/pgsql/functions/pg-put-copy-end.xml new file mode 100644 index 000000000000..799af94c857f --- /dev/null +++ b/reference/pgsql/functions/pg-put-copy-end.xml @@ -0,0 +1,83 @@ + + + + pg_put_copy_end + Signal the completion of a COPY operation to the server + + + + &reftitle.description; + + intpg_put_copy_end + PgSql\Connectionconnection + stringnullerror&null; + + + Sends an end-of-data indication to the server during a + COPY FROM STDIN operation. + + + + + &reftitle.parameters; + + + + connection + + &pgsql.parameter.connection; + + + + error + + + If not &null;, the COPY operation is forced to + fail with the given error message. + + + + + + + + + &reftitle.returnvalues; + + Returns 1 on success, 0 if the + data could not be queued (only in non-blocking mode), or + -1 on error. + + + + + &reftitle.seealso; + + + pg_put_copy_data + pg_query + + + + + + diff --git a/reference/pgsql/functions/pg-socket-poll.xml b/reference/pgsql/functions/pg-socket-poll.xml new file mode 100644 index 000000000000..85091a4526aa --- /dev/null +++ b/reference/pgsql/functions/pg-socket-poll.xml @@ -0,0 +1,108 @@ + + + + pg_socket_poll + Poll a PostgreSQL connection socket for read/write readiness + + + + &reftitle.description; + + intpg_socket_poll + resourcesocket + intread + intwrite + inttimeout-1 + + + Polls a PostgreSQL connection socket for read and/or write readiness. + The socket can be obtained using pg_socket. + This function is useful for implementing non-blocking, asynchronous + query workflows. + + + + + &reftitle.parameters; + + + + socket + + + A socket resource obtained from pg_socket. + + + + + read + + + Whether to check for read readiness. Pass 1 + to check, 0 to skip. + + + + + write + + + Whether to check for write readiness. Pass 1 + to check, 0 to skip. + + + + + timeout + + + The maximum number of milliseconds to wait. Pass + -1 to wait indefinitely, or + 0 to not wait at all. + + + + + + + + + &reftitle.returnvalues; + + Returns a positive value if the socket is ready, 0 + if the timeout was reached, or -1 on error. + + + + + &reftitle.seealso; + + + pg_socket + pg_consume_input + pg_send_query + + + + + + From ce3018be9741820cd1d2a7d03c0d97aa26c69146 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Mon, 25 May 2026 10:13:45 +0200 Subject: [PATCH 2/2] pgsql: use simpara for inline paragraphs --- .../pgsql/functions/pg-change-password.xml | 16 ++++++------- reference/pgsql/functions/pg-jit.xml | 8 +++---- .../pgsql/functions/pg-put-copy-data.xml | 12 +++++----- reference/pgsql/functions/pg-put-copy-end.xml | 12 +++++----- reference/pgsql/functions/pg-socket-poll.xml | 24 +++++++++---------- 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/reference/pgsql/functions/pg-change-password.xml b/reference/pgsql/functions/pg-change-password.xml index 0fc62072eb5a..0fa42bd15e32 100644 --- a/reference/pgsql/functions/pg-change-password.xml +++ b/reference/pgsql/functions/pg-change-password.xml @@ -13,12 +13,12 @@ stringuser stringpassword - + pg_change_password changes the password of a PostgreSQL user. This function uses the PQchangePassword libpq function which handles password encryption automatically based on the server's settings. - + @@ -34,17 +34,17 @@ user - + The name of the PostgreSQL user whose password to change. - + password - + The new password. - + @@ -53,9 +53,9 @@ &reftitle.returnvalues; - + &return.success; - + diff --git a/reference/pgsql/functions/pg-jit.xml b/reference/pgsql/functions/pg-jit.xml index 115bd8197950..5e0853e329c7 100644 --- a/reference/pgsql/functions/pg-jit.xml +++ b/reference/pgsql/functions/pg-jit.xml @@ -11,10 +11,10 @@ arraypg_jit PgSql\Connectionnullconnection&null; - + pg_jit returns an array with the JIT (Just-In-Time compilation) information of the PostgreSQL server. - + @@ -33,9 +33,9 @@ &reftitle.returnvalues; - + Returns an &array; containing the JIT information of the server. - + diff --git a/reference/pgsql/functions/pg-put-copy-data.xml b/reference/pgsql/functions/pg-put-copy-data.xml index bb3d9e874976..a31ac3a5281f 100644 --- a/reference/pgsql/functions/pg-put-copy-data.xml +++ b/reference/pgsql/functions/pg-put-copy-data.xml @@ -12,11 +12,11 @@ PgSql\Connectionconnection stringcmd - + Sends data to the server during a COPY FROM STDIN operation. A COPY command must have been issued via pg_query before calling this function. - + @@ -32,11 +32,11 @@ cmd - + The data to send to the server. A final newline is automatically added if not present. The data must be formatted according to the COPY command's format. - + @@ -45,11 +45,11 @@ &reftitle.returnvalues; - + Returns 1 on success, 0 if the data could not be queued (only in non-blocking mode), or -1 on error. - + diff --git a/reference/pgsql/functions/pg-put-copy-end.xml b/reference/pgsql/functions/pg-put-copy-end.xml index 799af94c857f..d519a822e95e 100644 --- a/reference/pgsql/functions/pg-put-copy-end.xml +++ b/reference/pgsql/functions/pg-put-copy-end.xml @@ -12,10 +12,10 @@ PgSql\Connectionconnection stringnullerror&null; - + Sends an end-of-data indication to the server during a COPY FROM STDIN operation. - + @@ -31,10 +31,10 @@ error - + If not &null;, the COPY operation is forced to fail with the given error message. - + @@ -43,11 +43,11 @@ &reftitle.returnvalues; - + Returns 1 on success, 0 if the data could not be queued (only in non-blocking mode), or -1 on error. - + diff --git a/reference/pgsql/functions/pg-socket-poll.xml b/reference/pgsql/functions/pg-socket-poll.xml index 85091a4526aa..d928cdc8ecb5 100644 --- a/reference/pgsql/functions/pg-socket-poll.xml +++ b/reference/pgsql/functions/pg-socket-poll.xml @@ -14,12 +14,12 @@ intwrite inttimeout-1 - + Polls a PostgreSQL connection socket for read and/or write readiness. The socket can be obtained using pg_socket. This function is useful for implementing non-blocking, asynchronous query workflows. - + @@ -29,37 +29,37 @@ socket - + A socket resource obtained from pg_socket. - + read - + Whether to check for read readiness. Pass 1 to check, 0 to skip. - + write - + Whether to check for write readiness. Pass 1 to check, 0 to skip. - + timeout - + The maximum number of milliseconds to wait. Pass -1 to wait indefinitely, or 0 to not wait at all. - + @@ -68,10 +68,10 @@ &reftitle.returnvalues; - + Returns a positive value if the socket is ready, 0 if the timeout was reached, or -1 on error. - +