diff --git a/reference/pdo/constants.xml b/reference/pdo/constants.xml index 36d98257f991..285a16ffe336 100644 --- a/reference/pdo/constants.xml +++ b/reference/pdo/constants.xml @@ -251,6 +251,13 @@ setting of the prefetch size. A larger prefetch size results in increased performance at the cost of higher memory usage. + + The PDO_PGSQL driver instead treats this attribute as a toggle: as of + PHP 8.5.0, a value of 0 enables lazy (single-row) + fetching; see the + PDO_PGSQL driver docs + for details. + diff --git a/reference/pdo_pgsql/pdo-pgsql.xml b/reference/pdo_pgsql/pdo-pgsql.xml index d2a72332dd47..edb20d6c7fb2 100644 --- a/reference/pdo_pgsql/pdo-pgsql.xml +++ b/reference/pdo_pgsql/pdo-pgsql.xml @@ -155,6 +155,32 @@ + + PDO::ATTR_PREFETCH + + + As of PHP 8.5.0, setting this attribute to 0 enables + lazy (single-row) fetching: rows are retrieved from the server one at a + time as they are fetched, instead of buffering the whole result set in + memory before the first PDOStatement::fetch + call. This reduces memory usage for large result sets. Any other value + keeps the default buffered behavior. + + + It can be set per connection with + PDO::setAttribute, or per statement via + the PDO::prepare or + PDO::query driver options. + + + + In lazy mode, a connection can have only one active statement at a + time. Running another statement silently discards any unread rows of + the previous one; no error is raised. + + + + Pdo\Pgsql::TRANSACTION_IDLE diff --git a/reference/pdo_pgsql/pdo/pgsql/copyfromarray.xml b/reference/pdo_pgsql/pdo/pgsql/copyfromarray.xml index e29012235a32..7f2e3ffed133 100644 --- a/reference/pdo_pgsql/pdo/pgsql/copyfromarray.xml +++ b/reference/pdo_pgsql/pdo/pgsql/copyfromarray.xml @@ -10,7 +10,7 @@ public boolPdo\Pgsql::copyFromArray stringtableName - arrayrows + arrayTraversablerows stringseparator"\t" stringnullAs"\\\\N" stringnullfields&null; @@ -37,8 +37,9 @@ rows - An indexed array of strings with fields - separated by separator. + An indexed array (or Traversable) of + strings with fields separated by + separator.