A fast PostgreSQL Database Client Library for Python/asyncio.
Add support for SCRAM-SHA-256 authentication. (by @jkatz in 2d76f50d)
Add PostgreSQL 12 support (by @elprans in 23261532)
Remove preexec_fn hack from test cluster management (by @elprans in 36ed11d2)
Fix DeprecationWarning in the docstring of copy_from_query() (by @elprans in 482a39ae)
Allow specifying the target version when generating the release log (by @elprans in 43a7b213)
Check for .flake8 after importing flake8 (by @dotlambda in aaeb7076)
Include .flake8 in PyPI tarball (by @dotlambda in 43c6b9ce)
fix timezone type label in docs (by @claws in e91e4911)
Fix _StatementCache.clear() PS memory leak (by @un-def in f4aa9bf4 for #416)
fix for warning_callback not yet defined (by @samuelcolvin in 354d9be5)
Fix assertion fail on copy_records_to_table (by Petr Reznikov in ae5a89db)
Do not look for a port in a Unix socket domain path (by @Lawouach in b773912d for #419)
Unquote connection string components properly (by @elprans in 5513b9d3 for #418)
Remove superfluous transaction from a cursor example (by @elprans in 32fccaad for #475)
Revert "Stop treating ReadyForQuery as a universal result indicator" to fix stability regression. (by @elprans in 04b67480)
Correctly ignore all incoming messages after the Terminate message (by @elprans in 787317fb)
Properly cleanup connections closed by remote (by @elprans in 4393a159 for #385)
Implement Record.get()
(by @elprans in 2b93ee55 for #330)
Internal asyncpg errors are now consistently raised as
InternalClientError
(by @elprans in 263de3ff)
Allow mappings as composite type input (by @elprans in eaa2fa1a for #349)
Add BitString.to_int()
and BitString.from_int()
(by @percontation in ffd134e8)
Allow 'sslmode' in DSNs (by @percontation in 0304288e)
Add support for specifying multiple host addresses when connecting (by @elprans in 1d650ed9 for #257)
Low-level protocol implementation has been tweaked and optimized for slightly better performance in certain scenarios (by @elprans in 7a816138 and cc053fe5)
Queries with cached statements now generate fewer TCP packets (by @aleksey-mashanov in bf071996)
Allow aliasing builtin types by name in set_builtin_type_codec()
(by @elprans in 687127ed)
Factor out generic PostgreSQL protocol helpers into a separate package (by @1st1 in f0adefc7)
Fix tests and enable CI for PostgreSQL 11 (by @elprans in ddb0ec29 and 716fd9d3)
Handle and ignore permission errors when attempting to read .pgpass (by @elprans in df7830f0 for #356)
Fix decoding of fractional timestamps before Postgres epoch (by @elprans in a7eaf2b3 for #363)
Official support for Python 3.7.
Fix garbage collection of connections and emit a ResourceWarning
if an unclosed connection is garbage collected.
(by @1st1 in d9a236e7 for #323)
Raise a clear error if there's a race in pool intialization. (by @1st1 in 3565ef8c for #320)
Channel names in Connection.add_listener()
and
Connection.remove_listener()
are now quoted properly.
(by @sqwishy in 3e6ade62)
Fixed endianness detection on *BSD systems. (by @elprans in 8c83add4 for #313)
Fixed handling of large type OIDs. (by @elprans in 2624bdb9 for #300)
Pool.close()
now waits until all acquired connections are released.
Hence, the below code will now hang indefinitely:
conn = await pool.acquire()
await pool.close()
Asyncpg will log a warning if pool.close()
takes over 60 seconds to
complete. It is advisable to use asyncio.wait_for()
to set a timeout.
Add support for reading passwords from .pgpass (by @elprans in 55a372fc for #267)
Add Connection.is_in_transaction()
(#297)
(by @bcaudell95 in cf523be7 for #297)
Added codec for built-in type tid (by @fantix in cddea9c1)
Allow setting custom codecs on domains and enumerated types (by @elprans in 3139322a)
Allow passing datetime.date
instances as timestamp input
(by @elprans in e8cc627a for #288)
Implement support for pool connection rotation (by @elprans in 4d209b75 for #291)
Prohibit non-iterable containers to be passed as array input (by @elprans in a2fa7b23)
Decode numeric zeros with correct scale (by Dmitriy Chugunov in 4124f7d2)
Fix handling of OIDs >= 2**31 (by @elprans in 8dd7a6cb for #279)
Make Pool.close()
wait until all checked out connections are released
(by @elprans in 7a0585ac for #290)
Fix type codec cache races (by @elprans in 482a1866 for #278)
Raise a consistent exception on input encoding errors (by @elprans in 0ddfa466 for #260)
asyncpg no longer uses the common statement cache for explicit
prepared statements, so Connection.prepare()
always returns a
new prepared statement (by @vangheem in a19ce50f).
Initialize statement codecs immediately after Prepare (by @elprans in 803c1155 for #241)
Fix server version parsing when it contains trailing data (by @elprans in 05dce25f for #250)
asyncpg now reports the server version as x.0.y for PostgreSQL 10.0 and later. This is in alignment with how upstream is interpreting the "minor" version component now. (@elprans in 1fa12fe2)
Support timeouts in Connection.close()
and Pool.release()
(by @elprans in bdfdd898 for #220)
Invalidate type cache on schema changes affecting statement result.
A new Connection.reload_schema_state()
method.
(by @vitaly-burovoy in b04556e9)
Add CrateDB detection (by @mfussenegger in afc1038f)
Make prepared statement uid generator global (by @1st1 in 3e43fcf5)
Document pgbouncer-related prepared statement breakage (by @elprans in 4a3713f7 for #121)
Fix unaligned access issues in host-network byte I/O on ARM (by @elprans in c04576db for #216)
Fix issues with timetz type I/O (by @vitaly-burovoy in 7b6c0833)
Consistently use postgres/postgres as database/user pair in tests (by @elprans in b4ce7403)
Fix Range.__hash__()
(by @eumiro in 46f468c9)
Guard transaction methods against underlying connection release (by @elprans in 59e2878b for #232)
Drop support for PostgreSQL 9.1 (by @elprans in eaf298b4)
Remove the deprecated "binary" parameter from Connection.set_type_codec()
(by @elprans in 9ad6625a)
Document that single fetches can return None (by @khazhyk in 23394c9d)
Fix type introspection being very slow on large databases (by @elprans in e0c44ced for #186)
Fix copy tests on PostgreSQL < 9.4 (by @elprans in 327058f8)
Fix DeprecationWarning in tests (by @elprans in 3f9523c2)
Fix intermittent authentication failures against PostgreSQL 10 servers (by @elprans in 498213e6 for #158)
Do not attempt to connect to Unix sockets on Windows when host is not set (by @elprans in 8a32fc4b for #184)
Guard against incorrect use of resources associated with a connection (by @elprans in 089ac818, 93bf26f3 for #190)
Warn when there are active listeners on a connection that is released (by @elprans in d085d2cc for #190)
Add a test for cursors on a standby replica. (by @elprans in c484a470 for #66)
Clarify the argument/parameter count mismatch exception (by @elprans in b6fe0186 for #178)
Fix TypeError
on get_attributes
when result has no columns
(by @fantix in f29de232)
protocol: Use try
-finally
explicitly every time we create a waiter
(by @1st1 in 50edd8c8)
Call correct parent constructor in InterfaceWarning.__init__
(by @elprans in eec98b0b)
Allow grabbing the version information programmatically. (by @s0undt3ch in fa6dbc46)
Use the general statement cache for type introspection (by @elprans in 57c9ffdc for #198)
Fix issues with inet type I/O (by @elprans in e54f02e6 for #37)
Handle inactive connection closes while stored in the pool (by @AmatanHead in 9744adee)
Implement as_dict()
method for PostgresMessage
.
(by @vitaly-burovoy in 90725f1f)
Add API for receiving log messages connection.add_log_listener()
.
(by @vitaly-burovoy and @1st1 in 1b1893df and f072f883 for #144)
Add support for "tuple" exchange format for codec overrides. (by @elprans in 0453243b and d27dda72)
Implement binary format codec for numeric type. (by @elprans in a5413eb0 for #157)
Fix boundary checks for integers. (by @vitaly-burovoy in e0829104 and dfcf1356)
Fix handling of NULL
s in copy_records_to_table().
(by @elprans in 991b1ae8 for #153)
Raise an error when a binary COPY FROM
is attempted w/o appropriate codec.
(by @elprans in 7aac14e2 for #157)
Fix Record.items()
to support duplicate keys. See #28 for details.
(by @1st1 in 39b390c3 for #28)
Fix Record.keys()
to correctly return duplicate keys. See #28.
(by @1st1 in b06114de for #28)
Call notifications listeners using loop.call_soon()
.
(by @1st1 in 83d08bd8)
Make PoolConnectionProxy
more dynamic. Fixes #155.
(by @1st1 in 6ca1f28b for #155)
Make sure set_type_codec()
overrides core codec for all formats.
(by @elprans in 9c32b86f for #140)
New severity "V" field as "severity_en" attribute. (by @vitaly-burovoy in 35bce5a8)
Make interval decoding logic match that of psycopg2. (by @elprans in 6b484433 for #150)