Files
php-src/ext/pdo_pgsql/pdo_pgsql.stub.php
武田 憲太郎 f4a17fdefd ext/pdo_pgsql: Add Pdo\Pgsql::ATTR_CHUNK_SIZE for chunked result fetching
Generalizes the lazy fetch added in GH-15287 by letting a statement choose
how many rows it fetches per chunk, trading memory for speed. ext/pgsql
already exposed this as pg_set_chunked_rows_size(); ext/pdo_pgsql had no
way to reach it.

ATTR_PREFETCH and ATTR_CHUNK_SIZE replace each other: setting one on the
connection clears the other, a statement given either does not inherit the
connection's value, and a chunk size of 1 or more wins when both are set on
the same statement. A chunk size cannot be combined with a statement-level
PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL, which throws a ValueError; a
connection-level chunk size is simply disabled by a scrollable statement.

Requires libpq 17 or later.

Close GH-23210
2026-08-27 05:12:15 +01:00

72 lines
2.5 KiB
PHP

<?php
/** @generate-class-entries */
namespace Pdo;
/**
* @strict-properties
* @not-serializable
*/
class Pgsql extends \PDO
{
/** @cvalue PDO_PGSQL_ATTR_DISABLE_PREPARES */
public const int ATTR_DISABLE_PREPARES = UNKNOWN;
#ifdef HAVE_PG_RESULT_MEMORY_SIZE
/** @cvalue PDO_PGSQL_ATTR_RESULT_MEMORY_SIZE */
public const int ATTR_RESULT_MEMORY_SIZE = UNKNOWN;
#endif
#ifdef HAVE_PG_SET_CHUNKED_ROWS_SIZE
/** @cvalue PDO_PGSQL_ATTR_CHUNK_SIZE */
public const int ATTR_CHUNK_SIZE = UNKNOWN;
#endif
/** @cvalue PGSQL_TRANSACTION_IDLE */
#[\Deprecated(since: "8.5", message: "as it has no effect")]
public const int TRANSACTION_IDLE = UNKNOWN;
/** @cvalue PGSQL_TRANSACTION_ACTIVE */
#[\Deprecated(since: "8.5", message: "as it has no effect")]
public const int TRANSACTION_ACTIVE = UNKNOWN;
/** @cvalue PGSQL_TRANSACTION_INTRANS */
#[\Deprecated(since: "8.5", message: "as it has no effect")]
public const int TRANSACTION_INTRANS = UNKNOWN;
/** @cvalue PGSQL_TRANSACTION_INERROR */
#[\Deprecated(since: "8.5", message: "as it has no effect")]
public const int TRANSACTION_INERROR = UNKNOWN;
/** @cvalue PGSQL_TRANSACTION_UNKNOWN */
#[\Deprecated(since: "8.5", message: "as it has no effect")]
public const int TRANSACTION_UNKNOWN = UNKNOWN;
public function escapeIdentifier(string $input): string {}
public function copyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
public function copyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
public function copyToArray(string $tableName, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): array|false {}
public function copyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {}
public function lobCreate(): string|false {}
/**
* Opens an existing large object stream. Must be called inside a transaction.
* @return resource|false
*/
public function lobOpen(string $oid, string $mode = "rb") {}
public function lobUnlink(string $oid): bool {}
public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {}
public function getPid(): int {}
public function setNoticeCallback(?callable $callback): void {}
}