From cee97e1a9d369b28aac75a8550effbab9d570506 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Fri, 18 Oct 2024 08:15:30 -0700 Subject: [PATCH] Test on PostgreSQL 17 (#1189) --- .github/workflows/tests.yml | 7 +++---- README.rst | 5 +++-- asyncpg/exceptions/__init__.py | 25 +++++++++++++++++++------ docs/index.rst | 2 +- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b5bc7f5..ce06e7f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,10 +51,9 @@ jobs: __version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) - name: Setup PostgreSQL - uses: tj-actions/install-postgresql@2a80e9368dff47cd05fee5bf3cf7d88f68c2f8e9 # v3.1.1 if: steps.release.outputs.version == 0 && matrix.os == 'macos-latest' - with: - postgresql-version: 16 + run: | + brew install postgresql - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -83,7 +82,7 @@ jobs: test-postgres: strategy: matrix: - postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16"] + postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16", "17"] runs-on: ubuntu-latest diff --git a/README.rst b/README.rst index f7583a89..32fd1693 100644 --- a/README.rst +++ b/README.rst @@ -14,8 +14,9 @@ framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.8 or later and is supported for PostgreSQL -versions 9.5 to 16. Older PostgreSQL versions or other databases implementing -the PostgreSQL protocol *may* work, but are not being actively tested. +versions 9.5 to 17. Other PostgreSQL versions or other databases +implementing the PostgreSQL protocol *may* work, but are not being +actively tested. Documentation diff --git a/asyncpg/exceptions/__init__.py b/asyncpg/exceptions/__init__.py index 8c97d5a0..752fd007 100644 --- a/asyncpg/exceptions/__init__.py +++ b/asyncpg/exceptions/__init__.py @@ -121,6 +121,10 @@ class StackedDiagnosticsAccessedWithoutActiveHandlerError(DiagnosticsError): sqlstate = '0Z002' +class InvalidArgumentForXqueryError(_base.PostgresError): + sqlstate = '10608' + + class CaseNotFoundError(_base.PostgresError): sqlstate = '20000' @@ -485,6 +489,10 @@ class IdleInTransactionSessionTimeoutError(InvalidTransactionStateError): sqlstate = '25P03' +class TransactionTimeoutError(InvalidTransactionStateError): + sqlstate = '25P04' + + class InvalidSQLStatementNameError(_base.PostgresError): sqlstate = '26000' @@ -900,6 +908,10 @@ class DuplicateFileError(PostgresSystemError): sqlstate = '58P02' +class FileNameTooLongError(PostgresSystemError): + sqlstate = '58P03' + + class SnapshotTooOldError(_base.PostgresError): sqlstate = '72000' @@ -1095,9 +1107,9 @@ class IndexCorruptedError(InternalServerError): 'FDWTableNotFoundError', 'FDWTooManyHandlesError', 'FDWUnableToCreateExecutionError', 'FDWUnableToCreateReplyError', 'FDWUnableToEstablishConnectionError', 'FeatureNotSupportedError', - 'ForeignKeyViolationError', 'FunctionExecutedNoReturnStatementError', - 'GeneratedAlwaysError', 'GroupingError', - 'HeldCursorRequiresSameIsolationLevelError', + 'FileNameTooLongError', 'ForeignKeyViolationError', + 'FunctionExecutedNoReturnStatementError', 'GeneratedAlwaysError', + 'GroupingError', 'HeldCursorRequiresSameIsolationLevelError', 'IdleInTransactionSessionTimeoutError', 'IdleSessionTimeoutError', 'ImplicitZeroBitPadding', 'InFailedSQLTransactionError', 'InappropriateAccessModeForBranchTransactionError', @@ -1112,6 +1124,7 @@ class IndexCorruptedError(InternalServerError): 'InvalidArgumentForPowerFunctionError', 'InvalidArgumentForSQLJsonDatetimeFunctionError', 'InvalidArgumentForWidthBucketFunctionError', + 'InvalidArgumentForXqueryError', 'InvalidAuthorizationSpecificationError', 'InvalidBinaryRepresentationError', 'InvalidCachedStatementError', 'InvalidCatalogNameError', 'InvalidCharacterValueForCastError', @@ -1184,9 +1197,9 @@ class IndexCorruptedError(InternalServerError): 'TooManyJsonObjectMembersError', 'TooManyRowsError', 'TransactionIntegrityConstraintViolationError', 'TransactionResolutionUnknownError', 'TransactionRollbackError', - 'TriggerProtocolViolatedError', 'TriggeredActionError', - 'TriggeredDataChangeViolationError', 'TrimError', - 'UndefinedColumnError', 'UndefinedFileError', + 'TransactionTimeoutError', 'TriggerProtocolViolatedError', + 'TriggeredActionError', 'TriggeredDataChangeViolationError', + 'TrimError', 'UndefinedColumnError', 'UndefinedFileError', 'UndefinedFunctionError', 'UndefinedObjectError', 'UndefinedParameterError', 'UndefinedTableError', 'UniqueViolationError', 'UnsafeNewEnumValueUsageError', diff --git a/docs/index.rst b/docs/index.rst index 02a8457d..e0f91813 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. **asyncpg** requires Python 3.8 or later and is supported for PostgreSQL -versions 9.5 to 16. Older PostgreSQL versions or other databases implementing +versions 9.5 to 17. Other PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Contents