PostgreSQL PDO Driver (PDO_PGSQL)
Introduction
PDO_PGSQL is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to PostgreSQL databases.
Resource Types
This extension defines a stream resource returned by Pdo\Pgsql::lobOpen().
Installation
Use --with-pdo-pgsql[=DIR] to install
the PDO PostgreSQL extension, where the optional [=DIR]
is the PostgreSQL base install directory, or the path to pg_config.
$ ./configure --with-pdo-pgsql
This extension requires libpq (the PostgreSQL C client library). As of PHP 8.4.0, libpq 10.0 or later is required.
Predefined Constants
The constants below are defined by
this driver, and will only be available when the extension has been either
compiled into PHP or dynamically loaded at runtime. In addition, these
driver-specific constants should only be used if you are using this driver.
Using driver-specific attributes with another driver may result in
unexpected behaviour. PDO::getAttribute() may be used to
obtain the PDO::ATTR_DRIVER_NAME attribute to check the
driver, if your code can run against multiple drivers.
-
PDO::PGSQL_ATTR_DISABLE_PREPARES(int) -
Alias of
Pdo\Pgsql::ATTR_DISABLE_PREPARES. As of PHP 8.5.0, this constant is deprecated. -
PDO::PGSQL_TRANSACTION_IDLE(int) -
Equivalent to
Pdo\Pgsql::TRANSACTION_IDLE. As of PHP 8.5.0, this constant is deprecated, as it has no effect. -
PDO::PGSQL_TRANSACTION_ACTIVE(int) -
Equivalent to
Pdo\Pgsql::TRANSACTION_ACTIVE. As of PHP 8.5.0, this constant is deprecated, as it has no effect. -
PDO::PGSQL_TRANSACTION_INTRANS(int) -
Equivalent to
Pdo\Pgsql::TRANSACTION_INTRANS. As of PHP 8.5.0, this constant is deprecated, as it has no effect. -
PDO::PGSQL_TRANSACTION_INERROR(int) -
Equivalent to
Pdo\Pgsql::TRANSACTION_INERROR. As of PHP 8.5.0, this constant is deprecated, as it has no effect. -
PDO::PGSQL_TRANSACTION_UNKNOWN(int) -
Equivalent to
Pdo\Pgsql::TRANSACTION_UNKNOWN. As of PHP 8.5.0, this constant is deprecated, as it has no effect.
General notes
Note:
byteacolumns are returned as stream resources. See Large Objects (LOBs) for how to read these values and how to bind data withPDO::PARAM_LOB.
Table of Contents
- PDO_PGSQL DSN — Connecting to PostgreSQL databases
- PDO::pgsqlCopyFromArray — Alias of Pdo\Pgsql::copyFromArray
- PDO::pgsqlCopyFromFile — Alias of Pdo\Pgsql::copyFromFile
- PDO::pgsqlCopyToArray — Alias of Pdo\Pgsql::copyToArray
- PDO::pgsqlCopyToFile — Alias of Pdo\Pgsql::copyToFile
- PDO::pgsqlGetNotify — Alias of Pdo\Pgsql::getNotify
- PDO::pgsqlGetPid — Alias of Pdo\Pgsql::getPid
- PDO::pgsqlLOBCreate — Alias of Pdo\Pgsql::lobCreate
- PDO::pgsqlLOBOpen — Alias of Pdo\Pgsql::lobOpen
- PDO::pgsqlLOBUnlink — Alias of Pdo\Pgsql::lobUnlink
