Skip to content

Upgrading postgres 2 to 3

Breaking2.6.4 → 3.5.20Breaking8Security1Platform1Deprecated2New24Changed11Fixed83Other1

Fetching 50 releases from GitHub…43 / 50
BreakingUpgrade verdict

6 breaking changes and a platform requirement change and a security fix.

  • Code catching ServerException for cancelled queries may need to catch the new exception type instead.
  • Old version 2 APIs are gone, so code that still uses them will stop working.
  • Zero or negative timeouts are now rejected when settings are built rather than silently meaning no timeout.
  • Two database error types now belong to a different parent error type, which can affect code that catches them.
Top 5 of 10 that need code or config changes

Dart SDK requirement changed in 3.5.8: >=3.0.0 <4.0.0 → ^3.9.0.

Breaking6
ServerException may be transformed into _PgQueryCancelledException, which is a PgException and TimeoutException but no longer a ServerException.
ServerException_PgQueryCancelledExceptionPgExceptionTimeoutException
Removes legacy v2 APIs that were originally planned for removal in 3.1.0.
Rejects connectTimeout/queryTimeout of Duration.zero or negative at settings construction instead of treating them as wait forever.
connectTimeoutqueryTimeoutDuration.zero
UniqueViolationException and ForeignKeyViolationException now extend ServerException instead of PgException.
UniqueViolationExceptionForeignKeyViolationExceptionServerExceptionPgException
Preparing or executing a statement on the main connection inside a runTx callback now throws an exception.
runTx
Removes @internal-annotated methods from the public API of ServerException and Severity.
ServerExceptionSeverity
Security1
Compares the SCRAM server signature in constant time in SASL and rejects servers that do not offer SCRAM-SHA-256.
SCRAM-SHA-256
Platform1
Raises the minimum Dart SDK to 3.4 due to the stack_trace dependency.
Deprecated2
Deprecates TupleDataColumn.data in favor of .value for binary protocol messages.
TupleDataColumn.dataTupleDataColumn.value
Deprecates some logical replication message parsing methods.