diff --git a/reference/pgsql/constants.xml b/reference/pgsql/constants.xml index d3dc79b3721e..f28f4d2816d1 100644 --- a/reference/pgsql/constants.xml +++ b/reference/pgsql/constants.xml @@ -251,6 +251,22 @@ + + + PGSQL_TUPLES_CHUNK + (int) + + + + Returned by pg_result_status. + Indicates the successful completion of a command returning data in chunked mode. + Returned for SELECT commands when + pg_set_chunked_rows_size is set. + The result set is divided into multiple chunks, each containing a predefined number of rows. + Available as of PHP 8.4.0 and libpq 17. + + + PGSQL_COPY_OUT diff --git a/reference/pgsql/functions/pg-result-status.xml b/reference/pgsql/functions/pg-result-status.xml index cd1ee4a0d25b..1b7dab983c9c 100644 --- a/reference/pgsql/functions/pg-result-status.xml +++ b/reference/pgsql/functions/pg-result-status.xml @@ -51,7 +51,7 @@ &reftitle.returnvalues; Possible return values are PGSQL_EMPTY_QUERY, - PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_COPY_OUT, + PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_TUPLES_CHUNK, PGSQL_COPY_OUT, PGSQL_COPY_IN, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and PGSQL_FATAL_ERROR if PGSQL_STATUS_LONG is specified. Otherwise, a string containing the PostgreSQL command tag is returned. diff --git a/reference/pgsql/functions/pg-set-chunked-rows-size.xml b/reference/pgsql/functions/pg-set-chunked-rows-size.xml new file mode 100644 index 000000000000..4a459b362130 --- /dev/null +++ b/reference/pgsql/functions/pg-set-chunked-rows-size.xml @@ -0,0 +1,121 @@ + + + + + pg_set_chunked_rows_size + Set the query results to be retrieved in chunk mode + + + + &reftitle.description; + + boolpg_set_chunked_rows_size + PgSql\Connectionconnection + intsize + + + Set the query results to be retrieved in chunk mode. + The query results returned afterward will be divided into multiple chunks, + each containing up to size rows. + This function must be called before retrieving results with pg_get_result. + This function is only available when libpq is version 17 or higher. + + + + + &reftitle.parameters; + + + connection + + &pgsql.parameter.connection; + + + + size + + + The number of rows to be retrieved in each chunk. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + If size is less than 1, + a ValueError will be thrown. + + + + + &reftitle.examples; + + <function>pg_result_memory_size</function> example + + + + &example.outputs; + + + + + + + + &reftitle.seealso; + + pg_get_result + pg_result_status + + + + diff --git a/reference/pgsql/versions.xml b/reference/pgsql/versions.xml index 2232618fabee..871df8159879 100644 --- a/reference/pgsql/versions.xml +++ b/reference/pgsql/versions.xml @@ -88,6 +88,7 @@ +