NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #4077 most downloaded on Packagist
Asynchronous PostgreSQL client for Amp.
Latest stable
v2.2.2
Last release 18 days ago
04 Nov 2026
Release timing varies
gaps range from 8 days to 1.3 years
Nearly every release is documented
notes for 29 of 30 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
36 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Fix transaction release race by @simPod in https://github.com/amphp/postgres/pull/73
Full Changelog: https://github.com/amphp/postgres/compare/v2.2.1...v2.2.2
Full Changelog: v2.2.1...v2.2.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Fixed generation of connection strings if a connection parameter value contains a space.
Full Changelog: v2.2.0...v2.2.1
Support Postgres config options by @PNixx in #70
Full Changelog: https://github.com/amphp/postgres/compare/v2.1.1...v2.2.0
Fixed handling of int2vector and oidvector fields when using ext-pgsql ( #68 ).
int2vector and oidvector fields when using ext-pgsql (#68).ext-pgsql. This query is only executed once per server upon the initial connection to that server. Using an async query will reduce latency when connecting to different Postgres servers.ext-pgsql.Full Changelog: v2.1.0...v2.1.1
Fixed type cast for numeric columns when using the ext-pgsql driver. The column value was being cast to a float, it is now cast to a string for parity
numeric columns when using the ext-pgsql driver. The column value was being cast to a float, it is now cast to a string for parity with the ext-pq driver to retain value precision. (#66)PostgresConnectionPool to set the default transaction level when constructing the pool.Full Changelog: v2.0.0...v2.1.0
Stable release compatible with AMPHP v3 and fibers! 🎉
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Postgres to avoid collisions with similar names from other libraries.Traversable, allowing them to be used with foreach to iterate over result rows.PostgresTransaction now extends PostgresLink instead of PostgresExecutor to support nested transactions.TimeoutConnector in favor of DefaultPostgresConnector which has a Cancellation parameter on connect() which may be used with an Amp\TimeoutCancellation.PostgresConnector since the interface was replaced by template types on SqlConnector, i.e. SqlConnector<PostgresConfig, PostgresConnection>BYTEA fields. (#57)PostgresConnection interface extending PostgresLink.Receiver interface. These methods are now a part of PostgresConnection.Quoter Interface. These methods are now a part of PostgresExecutor.amphp/sql-common@v2.0.0-beta.9.Full Changelog: v2.0.0-beta.5...v2.0.0-beta.6
Nested transactions have been refactored to be created simply with PostgresTransaction::beginTransaction() instead of needing to wrap a PostgresTransaction into a PostgresNestableTransaction. If you did not use savepoints or nested transactions, you likely will be able to upgrade to this version without any code changes.
amphp/sql@v2.0.0-beta.6 and amphp/sql-common@v2.0.0-beta.7. Removed PostgresNestableTransaction.PostgresConnection interface extending the base interface Connection from amphp/sql.PostgresQuoter methods into PostgresExecutor and removed PostgresQuoter.PostgresReceiver methods into PostgresConnection and removed PostgresReceiver.Full Changelog: v2.0.0-beta.4...v2.0.0-beta.5
ext-pgsql.BYTEA fields. (#57)PostgresNestableTransaction which may be optionally used to create a PostgresLink from a PostgresTransaction object. Nested transactions are implemented using savepoints.PostgresExecutor now extends PostgresQuoter, moving the interface lower in the interface hierarchy.Compatibility with amphp/sql-common@v2.0.0-beta.9.
amphp/sql-common@v2.0.0-beta.9.Full Changelog: https://github.com/amphp/postgres/compare/v2.0.0-beta.5...v2.0.0-beta.6
Nested transactions have been refactored to be created simply with PostgresTransaction::beginTransaction() instead of needing to wrap a PostgresTransa
Nested transactions have been refactored to be created simply with PostgresTransaction::beginTransaction() instead of needing to wrap a PostgresTransaction into a PostgresNestableTransaction. If you did not use savepoints or nested transactions, you likely will be able to upgrade to this version without any code changes.
amphp/sql@v2.0.0-beta.6 and amphp/sql-common@v2.0.0-beta.7. Removed PostgresNestableTransaction.PostgresConnection interface extending the base interface Connection from amphp/sql.PostgresQuoter methods into PostgresExecutor and removed PostgresQuoter.PostgresReceiver methods into PostgresConnection and removed PostgresReceiver.Full Changelog: https://github.com/amphp/postgres/compare/v2.0.0-beta.4...v2.0.0-beta.5
Fixed statements used in a nested transaction potentially deadlocking when using ext-pgsql.
ext-pgsql.Added support for BYTEA fields.
BYTEA fields. (#57)PostgresNestableTransaction which may be optionally used to create a PostgresLink from a PostgresTransaction object. Nested transactions are implemented using savepoints.PostgresExecutor now extends PostgresQuoter, moving the interface lower in the interface hierarchy.Compatibility with Result::fetchRow() added in `amphp/sql@2.0.0-beta.3`
Result::fetchRow() added in amphp/sql@2.0.0-beta.3BackedEnum instances in statement parametersPostgresConnector since the interface was replaced by template types on SqlConnector, i.e. SqlConnector<PostgresConfig, PostgresConnection>MONEY type columns from being cast to a float with ext-pgsql, which always resulted in a value of 0. MONEY columns will now be returned as a string, matching ext-pqErrorInitial release compatible with AMPHP v3.
Initial release compatible with AMPHP v3.
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Postgres as a prefix to interfaces and non-extension-specific classes.ConnectionConfig to PostgresConfigTimeoutConnector in favor of DefaultPostgresConnector, which has a Cancellation parameter on connect() (use Amp\TimeoutCancellation with this parameter for similar behavior to TimeoutConnector)Fixed cancelling an active query if a connection is closed when using ext-pgsql
ext-pgsql (#54)Fixed MONEY type columns from being cast to a float with ext-pgsql, which always resulted in a value of 0. MONEY columns will now be returned as a str
MONEY type columns from being cast to a float with ext-pgsql, which always resulted in a value of 0. MONEY columns will now be returned as a string, matching ext-pq.Fixed compatibility with PHP 8.1.
Fix foreach on null if an ext-pq connection poll fails.
Fixed type table caching for ext-pgsql.
another command is already in progress errors being emitted from the ext-pq driver that could happen during periods of heavy load. (#41, #44)Improved automatic type casting and parsing of array types in the ext-pgsql driver to cover all possible built-in and custom types by querying the ser
Improved automatic type casting and parsing of array types in the ext-pgsql driver to cover all possible built-in and custom types by querying the server for all type definitions and casting/parsing based on those definitions. Types are cached on the client based on the combination of host, port, and username.
Fixed case where operators containing question mark were erroneously substituted by the prepared statement parameter parser
Fixed PHP version requirement to allow PHP 8.
Fixed PHP version requirement to allow PHP 8.
Pool now uses DISCARD ALL instead of RESET ALL to restore pooled connections to initial state.
Pool now uses DISCARD ALL instead of RESET ALL to restore pooled connections to initial state. (#34)Added sslmode to the available connection configuration options. See https://www.postgresql.org/docs/current/libpq-ssl.html for possible modes.
sslmode to the available connection configuration options. See https://www.postgresql.org/docs/current/libpq-ssl.html for possible modes.ext-pq.QueryExecutionError.Fixed a bug where more than one transaction could be created on a connection if three or more transactions where requested simultaneously (this bug di
Removed circular reference in PgSqlHandle and PqHandle for faster GC.
PgSqlHandle and PqHandle for faster GC.Fixed parsing of empty arrays when using ext-pgsql
ext-pgsql (#21)Added methods to PqConnection to toggle result set buffering on and off: shouldBufferResults(), shouldNotBufferResults(), and isBufferingResults().
PqConnection to toggle result set buffering on and off: shouldBufferResults(), shouldNotBufferResults(), and isBufferingResults().Fixed statement reference counts if the same statement was prepared simultaneously on a single connection.
Connection that could delay automatic destruction and closure of a single connection.Fixed an issue where a transaction may have been released on a connection when there was an active query associated with the transaction, causing an a
Fixed an issue when using this library with `amphp/mysql` that caused the same Connector object to be returned by the connector() function in both lib
amphp/mysql that caused the same Connector object to be returned by the connector() function in both libraries.Fixed an issue where simultaneously preparing the same query in Pool would return two different StatementPool objects instead of the same object.
Pool would return two different StatementPool objects instead of the same object.The interface structure of this library changed significantly, however most consumers of this library should be able to upgrade from v0.2.x by only up
The interface structure of this library changed significantly, however most consumers of this library should be able to upgrade from v0.2.x by only updating the code initializing a connection or pool to use an instance of ConnectionConfig instead of a connection string. Using a connection or pool to perform queries has remained unchanged since v0.2.x, with the exception that transactions are now started with Link::beginTransaction() instead of Link::transaction().
? and named placeholders (e.g.: SELECT * FROM people WHERE name = :name). Named placeholders are used by providing an array with keys matching the placeholders: $statement->execute(['name' => $name]).ResultSet::getCurrent(). All rows are always returned as associate arrays.ext-pgsql. This matches the behavior when using pecl-pq.Statement and Pool that are shared with amphp/mysql are now in a separate library, amphp/sql.ConnectionConfig is now built with a list of parameters instead of a connection string. Use ConnectionConfig::fromString() to use a connection string.Operation interface has been dropped in favor of decorators. This interface was internally used to automatically free resources on destruction.Please review the interfaces in amphp/sql to ensure no other interface changes or method renames may affect your code.
Fixed an issue when a pool reached maximum size but a connection creation request was still pending, another subsequent request would enter an infinit
This release adds some new features and bugfixes while mostly maintaining compatibility with the prior release. Parameter changes to execute() is the
This release adds some new features and bugfixes while mostly maintaining compatibility with the prior release. Parameter changes to execute() is the most notable API break that will require some minor updates to existing code using this library.
Connection::execute() and Pool::execute() now use an array of query parameters as the second parameter instead of being variadic.Statement::execute() also uses an array of query parameters instead of being variadic.Pool no longer extends Connection. Instead Pool and Connection implement a new common interface, Link. Use Link if a pool or single connection may be used.TupleResult renamed to ResultSet and is now an interface. Result set classes have been renamed with ResultSet as a suffix (e.g.: PqUnbufferedResultSet).Pool::extractConnection() added to extract a connection from a pool. Once extracted, the connection will not automatically re-added to the pool.quoteString() and quoteName() added to Handle interface that quote value strings and identifier names respectively for safe insertion into query strings.QueryExecutionError exception class extending QueryError, adding a getDiagnostics() method that returns an array of debug information. See PQresultErrorField docs.isAlive() to Handle interface that returns false if the database connection has been closed. Connections in pool are automatically removed if isAlive() returns false.getQuery() to Statement interface that returns the prepared SQL string.Executor::prepare() instead of failing when trying to use Statement::execute().Multiple operations may be initiated on the same Connection object without errors. Operations are resolved in the order started.
Connection object without errors. Operations are resolved in the order started.Statement object.PgSqlStatement objects.Fixed an issue where some notifications would not be received when using ext-pgsql.
ext-pgsql.Nothing published for this version
One column per quarter.