PackageTrack
Sign in Get early access

postgres

PostgreSQL database driver. Supports binary protocol, connection pooling and statement reuse.

3.5.12 572K downloads/mo #478 most downloaded on pub.dev isoos/postgresql-dart

What this package is like to depend on

Last release 2 months ago

11 Jun 2026

Release timing varies

gaps range from 2 weeks to 7 months

Nearly every release is documented

notes for 72 of 74 stable releases

1 version withdrawn

withdrawn after publishing

10 years old

85 releases · first in 2016

6 releases in the last 12 months

see the full history below

Release timeline

85 releases · Sep 2016 to Jun 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 85
  1. 3.5.12 11 Jun 2026
    Release notes
    • Fix runTx silently rolling back after ROLLBACK TO SAVEPOINT recovery: clear stale _transactionException when PostgreSQL confirms a healthy transaction state.
    • Fix connection permanently blocked when BEGIN fails inside runTx (stale _activeTransaction state).
    • Fix connection left in undefined PostgreSQL state when ROLLBACK fails after a transaction error.
    • Fix untyped Uint8List parameters being encoded as an integer array literal: they are now encoded as a bytea hex literal.
    Open source →
  2. 3.5.11 11 May 2026
    Release notes
    • Adding JsonbListView with isSqlNull(int index) method to check if a JSONB array has SQL or JSON null value.
    • Fix double-timezone encoding bug.
    • Fix statement scope bug.
    Open source →
  3. 3.5.10 07 May 2026
    Release notes
    • Supporting BYTEA[] built-in type.
    • Fix TypedValue parameter propagation.
    Open source →
  4. 3.5.9 22 Oct 2025
    Release notes
    • Supporting multiple hosts in connection strings via comma-separated hosts or multiple host query parameters.
    • Unix socket connections via host query parameter (automatically detected when path contains /).
    • Supporting user/username, password, database, and port as query parameters in connection strings (override URL components).
    Open source →
  5. 3.5.8 03 Oct 2025
    Release notes
    • Upgraded SDK constraints and lints.
    • New SASL authenticator (reduce dependencies that haven't been updated for a while).
    • Supporting more URL-based connection-string parameters (mostly for pool).
    • Optimized StackTrace capture #432 by gmpassos.
    Open source →
  6. 3.5.7 01 Oct 2025
    Release notes
    • Supporting URL-based connection-string specification in Connection.openFromUrl and Pool.withUrl. (Note: feature and supported settings is considered experimental.)
    Open source →
  7. 3.5.6 13 Apr 2025
    Release notes
    • Accept null values as part of the binary List encodings.
    Open source →
  8. 3.5.5 26 Mar 2025
    Release notes
    • Better exception message when SSL is not supported.
    • Fix: typo in type specification (read -> real, also keeping read for compatibility).
    Open source →
  9. 3.5.4 21 Feb 2025
    Release notes

    Warning: This version fixes the inconsistency of 3.5.3 by:

    • UniqueViolationException and ForeignKeyViolationException extends ServerException instead of PgException, and
    • they no longer have public constructor (please open an issue if this is something you'd rely on).
    • The exception from cancelling the statement is also extends ServerException instead of PgException.
    Open source →
  10. 3.5.3 21 Feb 2025 withdrawn
    Release notes
    • New typed exceptions: UniqueViolationException, ForeignKeyViolationException. #416 by hurrba
    • Fix: don't reuse pool connections that are closed/closing. #417 by davidmartos96
    Open source →
  11. 3.5.2 14 Feb 2025
    Release notes
    • Fix: Pool connection timeout does not rely on package:pool's timeout, instead uses a separate Timer.
    Open source →
  12. 3.5.1 08 Feb 2025
    Release notes
    • Fix: ARRAY_AGG (and other arrays) may return [null].
    Open source →
  13. 3.5.0 18 Jan 2025
    Release notes
    • Better exception stacktraces (in some cases) using package:stack_trace.
    • With that dependency, upgraded minimum SDK to 3.4.
    Open source →
  14. 3.4.8 26 Dec 2024
    Release notes
    • Fix: Don't ignore de pool resource close call when using foce. #406 by davidmartos96.
    Open source →
  15. 3.4.7 22 Dec 2024
    Release notes
    Open source →
  16. 3.4.6 22 Dec 2024
    Release notes
    • Fix: do not close connection after an empty statement.
    • Fix: close(force: true) does not cause uncaught exception.
    Open source →
  17. 3.4.5 20 Dec 2024
    Release notes
    • close(force: true) to indicate intent to force-close pending queries and resources. #396 by davidmartos96
    • Fix: multiple message processing overlap bug when SSL mode was disabled.
    Open source →
  18. 3.4.4 20 Nov 2024
    Release notes
    • Fix: explicit closing of prepared statement portals in transactions to release table locks. #393
    Open source →
  19. 3.4.3 13 Nov 2024
    Release notes
    • Fix: prevent hanging state by forwarding protocol-level parsing errors into the message stream.
    Open source →
  20. 3.4.2 08 Nov 2024
    Release notes
    • Fix: When a transaction is rolled back, do not expose the exception on rollback, rather the original exception from the transaction.
    Open source →
  21. 3.4.1 02 Nov 2024
    Release notes
    • Do not allow exceptions escape when closing broken connection. #384 by pulyaevskiy.
    Open source →
  22. 3.4.0 17 Sep 2024
    Release notes
    • Connection.info (through ConnectionInfo class) exposes read-only connection-level information, e.g. acessing access server-provided parameter status values.
    • Support for binary pgoutput replication by wolframm.
    • Allowing custom type codecs:
      • Codec interface is used for encoding/decoding value by type OIDs or Dart values.
      • Codec.encode and Codec.decode gets a reference to CodecContext which provides access to encoding, observed runtime parameters and the TypeRegistry.
      • EncoderFn value converter for generic Dart object -> Postgres-encoded bytes (for values where type is not specified).
      • DatabaseInfo tracks information about relations and oids (currently limited to RelationMessage caching).
    • Timeout-related behaviour changes, may be breaking in some cases:
      • Preparing/executing a stamement on the main connection while in a runTx callback will throw an exception.
      • Setting timeout will try to actively cancel the current statement using a new connection.
      • ServerException may be transformed into _PgQueryCancelledException which is both PgException and TimeoutException (but no longer ServerException).
    • API deprecations:
      • Deprecated TupleDataColumn.data, use .value instead (for binary protocol messages).
      • Deprecated some logical replication message parsing method.
      • Removed @internal-annotated methods from the public API of ServerException and Severity.
    Open source →
  23. 3.4.0-dev.2 13 Sep 2024 pre-release

    Nothing published for this version

  24. 3.4.0-dev.1 05 Sep 2024 pre-release

    Nothing published for this version

  25. 3.3.0 21 Aug 2024
    Release notes

    Removed legacy v2 APIs. These APIs were meant to be removed in 3.1.0, but were kept for a bit longer, as they didn't have any drawback to be around. However, a planned redesign of the type customization would require to touch the v2 codebase and it is not worth the effort to keep it much longer.

    Open source →
  26. 3.2.1 18 May 2024
    Release notes
    • Added or fixed decoders support for QueryMode.simple: double, real, timestampWithTimezone, timestampWithoutTimezone, date, numeric, json, jsonb #338 by pst9354.
    Open source →
  27. 3.2.0 11 Apr 2024
    Release notes
    • Support for tsvector and tsquery types.
    • ResultRow.isSqlNull(int) returns true if the column's value was SQL NULL.
    • TypedValue.isSqlNull indicates SQL NULL (vs. JSON null).
    Open source →
  28. 3.1.2 14 Mar 2024
    Release notes
    • ConnectionSettings.onOpen callback to initialize a new connection and set connection-level variables.
    Open source →
  29. 3.1.1 27 Feb 2024
    Release notes
    • Use ':' (colon) for substitution and cast operator together #309 by xvrh.
    Open source →
  30. 3.1.0 21 Feb 2024
    Release notes

    Added the following PostgreSQL builtin types:

    • Geometric types line, lseg, path, polygon, box, circle
    • Range types int4range, int8range, daterange, tsrange, tstzrange
    • Time type time
    • Array types _int2, _date, _time, _timestamp, _timestamptz, _uuid

    Huge thanks for #294 by wolframm.

    Open source →
  31. 3.0.8 29 Jan 2024
    Release notes
    • Properly react to connection losses by reporting the database connection as closed.
    Open source →
  32. 3.0.7 24 Jan 2024
    Release notes
    • Allow cleartext passwords when secure connection is used. (#283 by simolus3)
    Open source →
  33. 3.0.6 17 Jan 2024
    Release notes
    • Allow passing a SecurityContext when opening postgres connections.
    Open source →
  34. 3.0.5 27 Dec 2023
    Release notes
    • Support for type char/character/bpchar.
    Open source →
  35. 3.0.4 14 Dec 2023
    Release notes
    • Fix: SSL connection problem handler.
    Open source →
  36. 3.0.3 05 Dec 2023
    Release notes
    • Using const for ConnectionSettings, SessionSettings and PoolSettings classes. (#267 by Gerrel)
    • Parsing of Sql.indexed and Sql.named happens when the Connection starts to interpret it. Errors with unknown type names are thrown in this later step.
    Open source →
  37. 3.0.2 27 Nov 2023
    Release notes
    • Fix: Dispose disconnected pool Connections. (#260 by nehzata).
    • Deprecated ParseMessage constructor's types argument, use typeOids instead. (As most users don't access this directly, it will be removed in 3.1.0).
    Open source →
  38. 3.0.1 19 Nov 2023
    Release notes
    • Fix: do not allow execute after closing the Connection.
    • Session.runTx() supports rolling back the transaction through TxSession.rollback() (otherwise any exception has the same effect, but callers need to catch it).
    • Supporting more type aliases, including serial4, serial8, integer...
    • Deprecated all of v2 API, legacy fallback will be removed in next minor version (3.1.0).
    Open source →
  39. 3.0.0 14 Nov 2023
    Release notes

    New features:

    • New API (better names and consistency).
    • New SQL parsing and configurable query substitutions.
    • Integrated connection pooling.
    • A somewhat-compatible legacy API support to help migrations (will be removed in 3.1.0).

    BREAKING CHANGES

    The package had a partial rewrite affecting public client API and internal behaviour, keeping most of the wire protocol handling from the old version.

    Users of this package must rewrite and test their application when upgrading.

    Notable breaking behaviour changes:

    • Simple query protocol allows sending queries to the server without awaiting on the result. The new implementation queues these request on the client instead.
    • Table name OIDs are not fetched or cached, this information from the result schema is absent, also causing mappedResultsQuery to be removed from the new API.
    • Queries are not cached implicitly, explicit prepared statements can be used instead.
    • interval values are returned as Interval type instead of Duration.
    • A newly added UndecodedBytes instances are returned when the package does not know or has not implemented the appropriate type decoding yet. Previously these values were auto-encoded to String and if that failed the Uint8List were used.
    • Types, fields and parameter names may have been renamed to be more consistent or more aligned with the Dart naming guides.

    Legacy compatibility layer

    package:postgres/legacy.dart provides a somewhat backwards-compatible API via the PostgreSQLConnection.withV3() constructor. Many features, including the ones mentioned above are missing and/or throw UnimplementedError when called.

    Migration

    • You may use the legacy compatibility layer to check if your code relies on any of the above mentioned feature, rewrite if needed.
    • Start using the new API, incrementally, when possible.
    • For most queries, you may use Sql.named('SELECT ...') to keep the default name- and Map-based query @variable`` substitution, or you may use the raw $1` version (with 1-based indexes).
    • Always write tests.

    If you have any issues with migration or with the new behavior, please open an issue on the package's GitHub issue tracker or discussions.

    Thanks

    The rewrite happened because of many contributions (including code, comments or criticism) on the new direction and design. I'd like to call out especially to simolus3 and osaxma, who helped to push forward.

    Open source →
  40. 3.0.0-beta.2 12 Nov 2023 pre-release
    Release notes

    see the latest 3.0.0 (pre)release

    Open source →
  41. 3.0.0-beta.1 31 Oct 2023 pre-release
    Release notes

    see the latest 3.0.0 (pre)release

    Open source →
  42. 3.0.0-alpha.1 21 Oct 2023 pre-release
    Release notes

    see the latest 3.0.0 (pre)release

    Open source →
  43. 2.6.4 21 Feb 2024

    Nothing published for this version

  44. 2.6.3 06 Oct 2023
    Release notes
    • Allow encoding to be specified for connections. The setting will be used for all connection-related string conversions.
    • Allow generic List type as substitution values in binary encoding (as long as the inner type matches).
    • Refactor: replaced UTF8BackedString with generic encoding (not complete).
    • Breaking change in package:postgres/messages.dart: default constructors made internal, parsing is done with more efficient reader.
    Open source →
  45. 2.6.2 30 Jul 2023
    Release notes
    Open source →
  46. 2.6.1 26 Feb 2023
    Release notes
    • Added support for bigInt (int8) arrays. #41 by schultek.
    Open source →
  47. 2.6.0 09 Feb 2023
    Release notes
    • Updated to package:lints.
    • Adding lowerCase values to AuthenticationScheme.
    • Add new package:postgres/postgres_v3_experimental.dart library as a preview. It exposes the postgres client under a new API that will replace the current one in version 3.0.0 of this package. At the moment, the new library is experimental and not fully implemented. Until the actual 3.0.0 release, the new APIs might change without a breaking version.
    Open source →
  48. 2.5.2 17 Sep 2022
    Release notes
    • Connecting without a password for non-trusted users throws an exception instead of timing out #68 by osaxma.
    Open source →
  49. 2.5.1 14 Sep 2022
    Release notes
    • Use substitutionValues with useSimpleQueryProtocol #62 by osaxma
    Open source →
  50. 2.5.0 10 Sep 2022
    Release notes
    • Added Support for Streaming Replication Protocol which included the following changes:
      • Replication Mode Messages Handling. #58 by osaxma
      • Add new message types for replication. #57 by osaxma
      • Add connection configuration for Streaming Replication Protocol. #56 by osaxma
      • Raise the min sdk version to support enhanced enums. #55 by osaxma
      • Add LSN type and time conversion to and from ms-since-Y2K. #53 by osaxma
      • Fix affected rows parsing in CommandCompleteMessage. #52 by osaxma
      • Introduced new APIs to PostgreSQLConnection: addMessage to send client messages, messages stream to listen to server messages & useSimpleQueryProtocol option in query method. #51 by osaxma
    Open source →
  51. 2.4.6 29 Jul 2022
    Release notes
    • Fix crash when manually issuing a transaction statement like BEGIN without using the high-level transaction APIs. #47 by simolus3.
    Open source →
  52. 2.4.5 20 Jun 2022
    Release notes
    Open source →
  53. 2.4.4 06 Jun 2022
    Release notes
    Open source →
  54. 2.4.3 30 Nov 2021
    Release notes
    • Support for clear text passwords using a boolean parameter in connection as 'allowClearTextPassword' to activate / deactivate the feature. #20.
    Open source →
  55. 2.4.2 05 Nov 2021
    Release notes
    Open source →
  56. 2.4.1 21 Aug 2021
    Release notes
    • Support for type interval, #10.
    Open source →
  57. 2.4.1+1 22 Aug 2021
    Release notes
    • Fix error when passing allowReuse: null into query() #8
    Open source →
  58. 2.4.1+2 22 Aug 2021
    Release notes
    • Fix error when sending json data with execute() #11
    Open source →
  59. 2.4.0 11 Aug 2021
    Release notes
    • Support for type numeric / decimal (#7, #9).
    • Support SASL / SCRAM-SHA-256 Authentication, #6.
    Open source →
  60. 2.3.2 14 Apr 2021
    Release notes
    • Expose ColumnDescription.typeId.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive