[DOC-CVS] [doc-en] master: Fix pgsql function signatures (#5355)

[email protected] (Louis-Arnaud via GitHub) Wed, 22 Apr 2026 13:06:25 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: kamil-tekiela
Date: 2026-04-22T14:06:22+01:00

Commit: https://github.com/php/doc-en/commit/c43a3cd9b49627b8d42a4b6ad530e10e26ca30dd
Raw diff: https://github.com/php/doc-en/commit/c43a3cd9b49627b8d42a4b6ad530e10e26ca30dd.diff

Fix pgsql function signatures (#5355)

* Fix pgsql function signatures to match php-src stubs

Return type fixes:
- pg_escape_identifier: false|string -> string, param $data -> $string
- pg_escape_literal: false|string -> string, param $data -> $string
- pg_parameter_status: false|string -> string, param name fixes
- pg_set_error_verbosity: false|int -> int

Parameter name fixes:
- pg_escape_bytea: $data -> $string
- pg_escape_string: $data -> $string
- pg_execute: $stmtname -> $statement_name
- pg_prepare: $stmtname -> $statement_name
- pg_lo_export: $pathname -> $filename
- pg_lo_import: $pathname -> $filename, $object_id -> $oid
- pg_put_line: $data -> $query

* Fix pgsql return/param types per review feedback

Changed paths:
  M  reference/pgsql/functions/pg-escape-bytea.xml
  M  reference/pgsql/functions/pg-escape-identifier.xml
  M  reference/pgsql/functions/pg-escape-literal.xml
  M  reference/pgsql/functions/pg-escape-string.xml
  M  reference/pgsql/functions/pg-execute.xml
  M  reference/pgsql/functions/pg-lo-export.xml
  M  reference/pgsql/functions/pg-lo-import.xml
  M  reference/pgsql/functions/pg-parameter-status.xml
  M  reference/pgsql/functions/pg-prepare.xml
  M  reference/pgsql/functions/pg-put-line.xml
  M  reference/pgsql/functions/pg-set-error-verbosity.xml


Diff:

diff --git a/reference/pgsql/functions/pg-escape-bytea.xml b/reference/pgsql/functions/pg-escape-bytea.xml
index 6c09c8a79432..7a171b5bf876 100644
--- a/reference/pgsql/functions/pg-escape-bytea.xml
+++ b/reference/pgsql/functions/pg-escape-bytea.xml
@@ -14,7 +14,7 @@
   <methodsynopsis>
    <type>string</type><methodname>pg_escape_bytea</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>data</parameter></methodparam>
+   <methodparam><type>string</type><parameter>string</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_escape_bytea</function> escapes string for
@@ -49,7 +49,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>data</parameter></term>
+     <term><parameter>string</parameter></term>
      <listitem>
       <para>
        A <type>string</type> containing text or binary data to be inserted into a bytea
diff --git a/reference/pgsql/functions/pg-escape-identifier.xml b/reference/pgsql/functions/pg-escape-identifier.xml
index efbb9066cfc0..c3b4b46ff2f1 100644
--- a/reference/pgsql/functions/pg-escape-identifier.xml
+++ b/reference/pgsql/functions/pg-escape-identifier.xml
@@ -12,9 +12,9 @@
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis>
-   <type>string</type><methodname>pg_escape_identifier</methodname>
+   <type class="union"><type>string</type><type>false</type></type><methodname>pg_escape_identifier</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>data</parameter></methodparam>
+   <methodparam><type>string</type><parameter>string</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_escape_identifier</function> escapes an identifier
@@ -42,7 +42,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>data</parameter></term>
+     <term><parameter>string</parameter></term>
      <listitem>
       <para>
        A <type>string</type> containing text to be escaped.
@@ -56,7 +56,7 @@
  <refsect1 role="returnvalues">
   &reftitle.returnvalues;
   <para>
-   A <type>string</type> containing the escaped data.
+   A <type>string</type> containing the escaped data, or &false; on failure.
   </para>
  </refsect1>
 
diff --git a/reference/pgsql/functions/pg-escape-literal.xml b/reference/pgsql/functions/pg-escape-literal.xml
index 9750270d49fd..12f6288d908d 100644
--- a/reference/pgsql/functions/pg-escape-literal.xml
+++ b/reference/pgsql/functions/pg-escape-literal.xml
@@ -12,9 +12,9 @@
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis>
-   <type>string</type><methodname>pg_escape_literal</methodname>
+   <type class="union"><type>string</type><type>false</type></type><methodname>pg_escape_literal</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>data</parameter></methodparam>
+   <methodparam><type>string</type><parameter>string</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_escape_literal</function> escapes a literal for
@@ -40,7 +40,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>data</parameter></term>
+     <term><parameter>string</parameter></term>
      <listitem>
       <para>
        A <type>string</type> containing text to be escaped.
@@ -54,7 +54,7 @@
  <refsect1 role="returnvalues">
   &reftitle.returnvalues;
   <para>
-   A <type>string</type> containing the escaped data.
+   A <type>string</type> containing the escaped data, or &false; on failure.
   </para>
  </refsect1>
 
diff --git a/reference/pgsql/functions/pg-escape-string.xml b/reference/pgsql/functions/pg-escape-string.xml
index 91db49522ec5..1cdb98544b9a 100644
--- a/reference/pgsql/functions/pg-escape-string.xml
+++ b/reference/pgsql/functions/pg-escape-string.xml
@@ -14,7 +14,7 @@
   <methodsynopsis>
    <type>string</type><methodname>pg_escape_string</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>data</parameter></methodparam>
+   <methodparam><type>string</type><parameter>string</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_escape_string</function> escapes a string for querying
@@ -40,7 +40,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>data</parameter></term>
+     <term><parameter>string</parameter></term>
      <listitem>
       <para>
        A <type>string</type> containing text to be escaped.
diff --git a/reference/pgsql/functions/pg-execute.xml b/reference/pgsql/functions/pg-execute.xml
index de68827fa1aa..812a8c83c6b3 100644
--- a/reference/pgsql/functions/pg-execute.xml
+++ b/reference/pgsql/functions/pg-execute.xml
@@ -12,7 +12,7 @@
   <methodsynopsis>
    <type class="union"><type>PgSql\Result</type><type>false</type></type><methodname>pg_execute</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>stmtname</parameter></methodparam>
+   <methodparam><type>string</type><parameter>statement_name</parameter></methodparam>
    <methodparam><type>array</type><parameter>params</parameter></methodparam>
   </methodsynopsis>
   <para>
@@ -44,7 +44,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>stmtname</parameter></term>
+     <term><parameter>statement_name</parameter></term>
      <listitem>
       <para>
        The name of the prepared statement to execute.  if
diff --git a/reference/pgsql/functions/pg-lo-export.xml b/reference/pgsql/functions/pg-lo-export.xml
index 5cfe3c74bf90..8eaf10e9e461 100644
--- a/reference/pgsql/functions/pg-lo-export.xml
+++ b/reference/pgsql/functions/pg-lo-export.xml
@@ -13,7 +13,7 @@
    <type>bool</type><methodname>pg_lo_export</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
    <methodparam><type>int</type><parameter>oid</parameter></methodparam>
-   <methodparam><type>string</type><parameter>pathname</parameter></methodparam>
+   <methodparam><type>string</type><parameter>filename</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_lo_export</function> takes a large object in a
@@ -50,7 +50,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>pathname</parameter></term>
+     <term><parameter>filename</parameter></term>
      <listitem>
       <para>
        The full path and file name of the file in which to write the
diff --git a/reference/pgsql/functions/pg-lo-import.xml b/reference/pgsql/functions/pg-lo-import.xml
index fee5dbafc4c1..59c7d7c38e1c 100644
--- a/reference/pgsql/functions/pg-lo-import.xml
+++ b/reference/pgsql/functions/pg-lo-import.xml
@@ -10,10 +10,10 @@
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis>
-   <type>int|string|false</type><methodname>pg_lo_import</methodname>
+   <type class="union"><type>int</type><type>string</type><type>false</type></type><methodname>pg_lo_import</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>pathname</parameter></methodparam>
-   <methodparam choice="opt"><type>mixed</type><parameter>object_id</parameter></methodparam>
+   <methodparam><type>string</type><parameter>filename</parameter></methodparam>
+   <methodparam choice="opt"><type class="union"><type>int</type><type>string</type></type><parameter>oid</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_lo_import</function> creates a new large object
@@ -42,7 +42,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>pathname</parameter></term>
+     <term><parameter>filename</parameter></term>
      <listitem>
       <para>
        The full path and file name of the file on the client
@@ -51,10 +51,10 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>object_id</parameter></term>
+     <term><parameter>oid</parameter></term>
      <listitem>
       <para>
-       If an <parameter>object_id</parameter> is given the function
+       If an <parameter>oid</parameter> is given the function
        will try to create a large object with this id, else a free
        object id is assigned by the server. The parameter
        relies on functionality that first
diff --git a/reference/pgsql/functions/pg-parameter-status.xml b/reference/pgsql/functions/pg-parameter-status.xml
index 24c22a987190..b34631de9864 100644
--- a/reference/pgsql/functions/pg-parameter-status.xml
+++ b/reference/pgsql/functions/pg-parameter-status.xml
@@ -9,9 +9,9 @@
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis>
-   <type>string</type><methodname>pg_parameter_status</methodname>
+   <type class="union"><type>string</type><type>false</type></type><methodname>pg_parameter_status</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>param_name</parameter></methodparam>
+   <methodparam><type>string</type><parameter>name</parameter></methodparam>
   </methodsynopsis>
   <para>
     Looks up a current parameter setting of the server.
@@ -44,13 +44,13 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>param_name</parameter></term>
+     <term><parameter>name</parameter></term>
      <listitem>
         <para>
-         Possible <parameter>param_name</parameter> values include <literal>server_version</literal>, 
-        <literal>server_encoding</literal>, <literal>client_encoding</literal>, 
-        <literal>is_superuser</literal>, <literal>session_authorization</literal>, 
-        <literal>DateStyle</literal>, <literal>TimeZone</literal>, and 
+         Possible <parameter>name</parameter> values include <literal>server_version</literal>,
+        <literal>server_encoding</literal>, <literal>client_encoding</literal>,
+        <literal>is_superuser</literal>, <literal>session_authorization</literal>,
+        <literal>DateStyle</literal>, <literal>TimeZone</literal>, and
         <literal>integer_datetimes</literal>.  Note that this value is case-sensitive.
         </para>
      </listitem>
@@ -62,7 +62,7 @@
  <refsect1 role="returnvalues">
   &reftitle.returnvalues;
   <para>A <type>string</type> containing the value of the parameter, &false; on failure or invalid
-  <parameter>param_name</parameter>.</para>
+  <parameter>name</parameter>.</para>
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/pgsql/functions/pg-prepare.xml b/reference/pgsql/functions/pg-prepare.xml
index 0a9cda69f8fd..f2f7f3447bce 100644
--- a/reference/pgsql/functions/pg-prepare.xml
+++ b/reference/pgsql/functions/pg-prepare.xml
@@ -15,7 +15,7 @@
   <methodsynopsis>
    <type class="union"><type>PgSql\Result</type><type>false</type></type><methodname>pg_prepare</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>stmtname</parameter></methodparam>
+   <methodparam><type>string</type><parameter>statement_name</parameter></methodparam>
    <methodparam><type>string</type><parameter>query</parameter></methodparam>
   </methodsynopsis>
   <para>
@@ -25,8 +25,8 @@
    be parsed and planned just once, rather than each time they are executed.
   </para>
   <para>
-   The function creates a prepared statement named <parameter>stmtname</parameter> from the <parameter>query</parameter>
-   string, which must contain a single SQL command. <parameter>stmtname</parameter> may be <literal>""</literal> to
+   The function creates a prepared statement named <parameter>statement_name</parameter> from the <parameter>query</parameter>
+   string, which must contain a single SQL command. <parameter>statement_name</parameter> may be <literal>""</literal> to
    create an unnamed statement, in which case any pre-existing unnamed
    statement is automatically replaced; otherwise it is an error if the
    statement name is already defined in the current session. If any parameters
@@ -53,7 +53,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>stmtname</parameter></term>
+     <term><parameter>statement_name</parameter></term>
      <listitem>
       <para>
        The name to give the prepared statement.  Must be unique per-connection.  If
diff --git a/reference/pgsql/functions/pg-put-line.xml b/reference/pgsql/functions/pg-put-line.xml
index 373a2fe51795..17f994127f11 100644
--- a/reference/pgsql/functions/pg-put-line.xml
+++ b/reference/pgsql/functions/pg-put-line.xml
@@ -12,7 +12,7 @@
   <methodsynopsis>
    <type>bool</type><methodname>pg_put_line</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
-   <methodparam><type>string</type><parameter>data</parameter></methodparam>
+   <methodparam><type>string</type><parameter>query</parameter></methodparam>
   </methodsynopsis>
   <para>
    <function>pg_put_line</function> sends a NULL-terminated string
@@ -57,7 +57,7 @@
      </listitem>
     </varlistentry>
     <varlistentry>
-     <term><parameter>data</parameter></term>
+     <term><parameter>query</parameter></term>
      <listitem>
       <para>
        A line of text to be sent directly to the PostgreSQL backend.  A <literal>NULL</literal>
diff --git a/reference/pgsql/functions/pg-set-error-verbosity.xml b/reference/pgsql/functions/pg-set-error-verbosity.xml
index 5e2dc90509d9..be5608e9b7e5 100644
--- a/reference/pgsql/functions/pg-set-error-verbosity.xml
+++ b/reference/pgsql/functions/pg-set-error-verbosity.xml
@@ -13,7 +13,7 @@
  <refsect1 role="description">
   &reftitle.description;
   <methodsynopsis>
-   <type>int</type><methodname>pg_set_error_verbosity</methodname>
+   <type class="union"><type>int</type><type>false</type></type><methodname>pg_set_error_verbosity</methodname>
    <methodparam choice="opt"><type>PgSql\Connection</type><parameter>connection</parameter></methodparam>
    <methodparam><type>int</type><parameter>verbosity</parameter></methodparam>
   </methodsynopsis>
@@ -61,7 +61,7 @@
   <para>
    The previous verbosity level: <constant>PGSQL_ERRORS_TERSE</constant>,
    <constant>PGSQL_ERRORS_DEFAULT</constant>
-   or <constant>PGSQL_ERRORS_VERBOSE</constant>.
+   or <constant>PGSQL_ERRORS_VERBOSE</constant>, or &false; on failure.
   </para>
  </refsect1>