[doc-en] master: Pdo\Pgsql: document ATTR_CHUNK_SIZE (PHP 8.6) (#6078)
| From: | KentarouTakeda via GitHub | Date: | Sat, 14 Nov 2026 08:02:52 +0000 |
| Subject: | [doc-en] master: Pdo\Pgsql: document ATTR_CHUNK_SIZE (PHP 8.6) (#6078) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23951@lists.php.net to get a copy of this message | ||
Author: KentarouTakeda (KentarouTakeda)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-11-14T09:02:49+01:00
Commit: https://github.com/php/doc-en/commit/6816d24b1a44f0180c46b6dd28b5aeb60a15a30b
Raw diff: https://github.com/php/doc-en/commit/6816d24b1a44f0180c46b6dd28b5aeb60a15a30b.diff
Pdo\Pgsql: document ATTR_CHUNK_SIZE (PHP 8.6) (#6078)
Changed paths:
M reference/pdo_pgsql/pdo-pgsql.xml
Diff:
diff --git a/reference/pdo_pgsql/pdo-pgsql.xml b/reference/pdo_pgsql/pdo-pgsql.xml
index 5888c54d7f76..bbe1ccf9ba73 100644
--- a/reference/pdo_pgsql/pdo-pgsql.xml
+++ b/reference/pdo_pgsql/pdo-pgsql.xml
@@ -88,6 +88,12 @@
<type>int</type>
<varname
linkend="pdo-pgsql.constants.attr-result-memory-size">Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE</varname>
</fieldsynopsis>
+ <fieldsynopsis>
+ <modifier>public</modifier>
+ <modifier>const</modifier>
+ <type>int</type>
+ <varname
linkend="pdo-pgsql.constants.attr-chunk-size">Pdo\Pgsql::ATTR_CHUNK_SIZE</varname>
+ </fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
@@ -169,8 +175,12 @@
<simpara>
It can be set per connection with
<methodname>PDO::setAttribute</methodname>, or per statement via
- the <methodname>PDO::prepare</methodname> or
- <methodname>PDO::query</methodname> driver options.
+ the <methodname>PDO::prepare</methodname> driver options.
+ </simpara>
+ <simpara>
+ With lazy fetching, <methodname>PDOStatement::rowCount</methodname>
+ returns the number of rows most recently retrieved from the server,
+ not the total.
</simpara>
<caution>
<simpara>
@@ -181,6 +191,44 @@
</caution>
</listitem>
</varlistentry>
+ <varlistentry xml:id="pdo-pgsql.constants.attr-chunk-size">
+ <term><constant>Pdo\Pgsql::ATTR_CHUNK_SIZE</constant></term>
+ <listitem>
+ <simpara>
+ The maximum number of rows retrieved from the server at a time during
+ lazy fetching.
+ It allows balancing speed against memory usage.
+ </simpara>
+ <simpara>
+ A value from <literal>1</literal> to <literal>2147483647</literal>
+ enables lazy fetching and takes precedence over
+ <constant>PDO::ATTR_PREFETCH</constant>.
+ With the default value of <literal>0</literal>,
+ <constant>PDO::ATTR_PREFETCH</constant> determines how rows are fetched.
+ Other integers throw a <exceptionname>ValueError</exceptionname>.
+ </simpara>
+ <simpara>
+ Like <constant>PDO::ATTR_PREFETCH</constant>, it can be set per
+ connection or per statement.
+ Setting <constant>PDO::ATTR_PREFETCH</constant> on the connection or on
+ a statement overrides the connection's chunk size.
+ </simpara>
+ <simpara>
+ A statement with <constant>PDO::ATTR_CURSOR</constant> set to
+ <constant>PDO::CURSOR_SCROLL</constant> ignores the connection's chunk
+ size.
+ Setting this attribute to <literal>1</literal> or more on such a
+ statement throws a <exceptionname>ValueError</exceptionname>.
+ </simpara>
+ <simpara>
+ For the caveats of lazy fetching, see
+ <link
linkend="pdo-pgsql.constants.attr-prefetch">PDO::ATTR_PREFETCH</link>.
+ </simpara>
+ <simpara>
+ Available as of PHP 8.6.0, when compiled against libpq >= 17.
+ </simpara>
+ </listitem>
+ </varlistentry>
<varlistentry xml:id="pdo-pgsql.constants.transaction-idle">
<term><constant>Pdo\Pgsql::TRANSACTION_IDLE</constant></term>
<listitem>