diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 26f1fd4b7..d65b1a38e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - pgVersion: [13, 14, 15, 16, 17] + pgVersion: [14, 15, 16, 17] name: PG ${{ matrix.pgVersion }} runs-on: ubuntu-24.04 defaults: diff --git a/CHANGELOG.md b/CHANGELOG.md index c6426c26c..4da8f796f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. From versio ### Changed +- Drop support for PostgreSQL EOL version 13 by @wolfgangwalther in #4193 - All responses now include a `Vary` header by @develop7 in #4609 - Log error when `db-schemas` config contains schema `pg_catalog` or `information_schema` by @taimoorzaeem in #4359 + Now fails at startup. Prior to this, it failed with `PGRST205` on requests related to these schemas. diff --git a/default.nix b/default.nix index 09af0f1d0..9e8c5783a 100644 --- a/default.nix +++ b/default.nix @@ -56,7 +56,6 @@ let { name = "pg-16"; postgresql = pkgs.postgresql_16.withPackages (p: [ p.postgis p.pg_safeupdate ]); } { name = "pg-15"; postgresql = pkgs.postgresql_15.withPackages (p: [ p.postgis p.pg_safeupdate ]); } { name = "pg-14"; postgresql = pkgs.postgresql_14.withPackages (p: [ p.postgis p.pg_safeupdate ]); } - { name = "pg-13"; postgresql = pkgs.postgresql_13.withPackages (p: [ p.postgis p.pg_safeupdate ]); } ]; haskellPackages = pkgs.haskell.packages."${compiler}"; diff --git a/docs/explanations/install.rst b/docs/explanations/install.rst index 0423ab2d7..4439bd895 100644 --- a/docs/explanations/install.rst +++ b/docs/explanations/install.rst @@ -16,7 +16,7 @@ Supported PostgreSQL versions ============================= =============== ================================= -**Supported** PostgreSQL >= 13 +**Supported** PostgreSQL >= 14 =============== ================================= PostgREST works with all PostgreSQL versions still `officially supported `_. diff --git a/nix/README.md b/nix/README.md index cc4b4ef59..aa5f8074c 100644 --- a/nix/README.md +++ b/nix/README.md @@ -91,13 +91,13 @@ postgrest-gen-ctags postgrest-watch postgrest-gen-jwt postgrest-with-all postgrest-gen-secret postgrest-with-git postgrest-git-hooks postgrest-with-pgrst -postgrest-hsie-graph-modules postgrest-with-pg-13 -postgrest-hsie-graph-symbols postgrest-with-pg-14 -postgrest-hsie-minimal-imports postgrest-with-pg-15 -postgrest-lint postgrest-with-pg-16 -postgrest-loadtest postgrest-with-pg-17 -postgrest-loadtest-against postgrest-with-slow-pg -postgrest-loadtest-report postgrest-with-slow-postgrest +postgrest-hsie-graph-modules postgrest-with-pg-14 +postgrest-hsie-graph-symbols postgrest-with-pg-15 +postgrest-hsie-minimal-imports postgrest-with-pg-16 +postgrest-lint postgrest-with-pg-17 +postgrest-loadtest postgrest-with-slow-pg +postgrest-loadtest-against postgrest-with-slow-postgrest +postgrest-loadtest-report postgrest-nixpkgs-upgrade ... @@ -174,7 +174,7 @@ $ nix-shell --run "postgrest-with-all postgrest-test-spec" # Run the tests against a specific version of PostgreSQL (use tab-completion in # nix-shell to see all available versions): -$ nix-shell --run "postgrest-with-pg-13 postgrest-test-spec" +$ nix-shell --run "postgrest-with-pg-17 postgrest-test-spec" ``` diff --git a/src/PostgREST/Config/PgVersion.hs b/src/PostgREST/Config/PgVersion.hs index 6db42e90b..fe5b46df1 100644 --- a/src/PostgREST/Config/PgVersion.hs +++ b/src/PostgREST/Config/PgVersion.hs @@ -3,7 +3,6 @@ module PostgREST.Config.PgVersion ( PgVersion(..) , minimumPgVersion - , pgVersion140 , pgVersion150 , pgVersion170 ) where @@ -25,10 +24,7 @@ instance Ord PgVersion where -- | Tells the minimum PostgreSQL version required by this version of PostgREST minimumPgVersion :: PgVersion -minimumPgVersion = pgVersion130 - -pgVersion130 :: PgVersion -pgVersion130 = PgVersion 130000 "13.0" "13.0" +minimumPgVersion = pgVersion140 pgVersion140 :: PgVersion pgVersion140 = PgVersion 140000 "14.0" "14.0" diff --git a/test/spec/Feature/Query/InsertSpec.hs b/test/spec/Feature/Query/InsertSpec.hs index 0b1e2678a..be895e659 100644 --- a/test/spec/Feature/Query/InsertSpec.hs +++ b/test/spec/Feature/Query/InsertSpec.hs @@ -11,13 +11,11 @@ import Test.Hspec.Wai import Test.Hspec.Wai.JSON import Text.Heredoc -import PostgREST.Config.PgVersion (PgVersion, pgVersion140) - import Protolude hiding (get) import SpecHelper -spec :: PgVersion -> SpecWith ((), Application) -spec actualPgVersion = do +spec :: SpecWith ((), Application) +spec = do describe "Posting new record" $ do context "disparate json types" $ do it "accepts disparate json types" $ do @@ -554,19 +552,12 @@ spec actualPgVersion = do {"a": "val", "b": "val"} ]|] `shouldRespondWith` - (if actualPgVersion < pgVersion140 - then [json| { - "code": "42601", - "details": "Column \"b\" is a generated column.", - "hint": null, - "message": "cannot insert into column \"b\"" - }|] - else [json| { - "code": "428C9", - "details": "Column \"b\" is a generated column.", - "hint": null, - "message": "cannot insert a non-DEFAULT value into column \"b\"" - }|]) + [json| { + "code": "428C9", + "details": "Column \"b\" is a generated column.", + "hint": null, + "message": "cannot insert a non-DEFAULT value into column \"b\"" + }|] { matchStatus = 400 } it "inserts a default on a DOMAIN with default" $ diff --git a/test/spec/Main.hs b/test/spec/Main.hs index a7f9ee7aa..9d1c278b9 100644 --- a/test/spec/Main.hs +++ b/test/spec/Main.hs @@ -150,7 +150,7 @@ main = do , ("Feature.Query.DeleteSpec" , Feature.Query.DeleteSpec.spec) , ("Feature.Query.EmbedDisambiguationSpec" , Feature.Query.EmbedDisambiguationSpec.spec) , ("Feature.Query.EmbedInnerJoinSpec" , Feature.Query.EmbedInnerJoinSpec.spec) - , ("Feature.Query.InsertSpec" , Feature.Query.InsertSpec.spec actualPgVersion) + , ("Feature.Query.InsertSpec" , Feature.Query.InsertSpec.spec) , ("Feature.Query.JsonOperatorSpec" , Feature.Query.JsonOperatorSpec.spec) , ("Feature.Query.NullsStripSpec" , Feature.Query.NullsStripSpec.spec) , ("Feature.Query.PgErrorCodeMappingSpec" , Feature.Query.ErrorSpec.pgErrorCodeMapping)