diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bd9439a7..2e59a63c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ jobs: - image: circleci/buildpack-deps:trusty environment: - PGHOST=localhost - - image: circleci/postgres:9.4 + - image: circleci/postgres:9.5 environment: - POSTGRES_USER=circleci - POSTGRES_DB=circleci @@ -183,9 +183,6 @@ jobs: - run: name: Install testing scripts command: nix-env -f default.nix -iA tests tests.ioTests tests.memoryTests - - run: - name: Run the spec tests against PostgreSQL 9.4 - command: postgrest-test-spec-postgresql-9.4 - run: name: Run the spec tests against PostgreSQL 9.5 command: postgrest-test-spec-postgresql-9.5 diff --git a/CHANGELOG.md b/CHANGELOG.md index b28fb6b8c..6c49a343d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - #1475, Location header for POST request is only included when PK is available on the table (#1461) - @wolfgangwalther - #1560, Volatile RPC called with GET now returns 405 Method not Allowed instead of 500 - @wolfgangwalther - #1604, Change the default logging level to `log-level=error`. Only requests with a status greater or equal than 500 will be logged. If you wish to go back to the previous behaviour and log all the requests, use `log-level=info` - @steve-chavez + - #1617, Dropped support for PostgreSQL 9.4 - @wolfgangwalther ## [7.0.1] - 2020-05-18 diff --git a/default.nix b/default.nix index bb8df0cfe..fadebb04b 100644 --- a/default.nix +++ b/default.nix @@ -32,7 +32,6 @@ let overlays = [ allOverlays.postgresql-default - allOverlays.postgresql-legacy allOverlays.gitignore allOverlays.ghr (allOverlays.haskell-packages { inherit compiler; }) @@ -50,7 +49,6 @@ let postgresql-10 = pkgs.postgresql_10; "postgresql-9.6" = pkgs.postgresql_9_6; "postgresql-9.5" = pkgs.postgresql_9_5; - "postgresql-9.4" = pkgs.postgresql_9_4; }; patches = diff --git a/nix/README.md b/nix/README.md index 4ff1bbf22..fdefb43ac 100644 --- a/nix/README.md +++ b/nix/README.md @@ -70,7 +70,7 @@ The PostgREST utilities available in `nix-shell` all have names that begin with [nix-shell]$ postgrest- postgrest-lint postgrest-test-spec-postgresql-11 postgrest-style postgrest-test-spec-postgresql-12 -postgrest-style-check postgrest-test-spec-postgresql-9.4 +postgrest-style-check postgrest-test-spec-postgresql-13 postgrest-test-spec postgrest-test-spec-postgresql-9.5 postgrest-test-spec-all postgrest-test-spec-postgresql-9.6 postgrest-test-spec-postgresql-10 @@ -91,7 +91,7 @@ $ nix-shell --arg ioTests true postgrest-lint postgrest-test-spec-postgresql-10 postgrest-style postgrest-test-spec-postgresql-11 postgrest-style-check postgrest-test-spec-postgresql-12 -postgrest-test-io postgrest-test-spec-postgresql-9.4 +postgrest-test-io postgrest-test-spec-postgresql-13 postgrest-test-spec postgrest-test-spec-postgresql-9.5 postgrest-test-spec-all postgrest-test-spec-postgresql-9.6 diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index b00ffe74d..57e08b9f2 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -3,5 +3,4 @@ ghr = import ./ghr; haskell-packages = import ./haskell-packages.nix; postgresql-default = import ./postgresql-default.nix; - postgresql-legacy = import ./postgresql-legacy.nix; } diff --git a/nix/overlays/postgresql-legacy.nix b/nix/overlays/postgresql-legacy.nix deleted file mode 100644 index d68a74cb5..000000000 --- a/nix/overlays/postgresql-legacy.nix +++ /dev/null @@ -1,20 +0,0 @@ -self: super: -# Overlay that adds legacy versions of PostgreSQL that are supported by -# PostgREST. -{ - # PostgreSQL 9.4 was removed from Nixpkgs with - # https://github.com/NixOS/nixpkgs/commit/8e2fc57a80d761c46702c3250e61c1bffe021e25 - # We pin its parent commit 3b5b9a7 to get the last version that was available. - postgresql_9_4 = - let - rev = "3b5b9a73f59ff93d50156e250203410bdd07f4e0"; - tarballHash = "0kr25xqbv1ldp72jbmml21pc5hl7xcfqhclv5qxa5f860jddjznk"; - - pinnedPkgs = - builtins.fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz"; - sha256 = tarballHash; - }; - in - (import pinnedPkgs { }).pkgs.postgresql_9_4; -} diff --git a/src/PostgREST/Types.hs b/src/PostgREST/Types.hs index abc1a184d..52a216bde 100644 --- a/src/PostgREST/Types.hs +++ b/src/PostgREST/Types.hs @@ -385,7 +385,7 @@ data LogicTree = Expr Bool LogicOperator [LogicTree] | Stmnt Filter deriving (Sh type FieldName = Text {-| - Json path operations as specified in https://www.postgresql.org/docs/9.4/static/functions-json.html + Json path operations as specified in https://www.postgresql.org/docs/current/static/functions-json.html -} type JsonPath = [JsonOperation] -- | Represents the single arrow `->` or double arrow `->>` operators @@ -492,10 +492,7 @@ instance Ord PgVersion where -- | Tells the minimum PostgreSQL version required by this version of PostgREST minimumPgVersion :: PgVersion -minimumPgVersion = pgVersion94 - -pgVersion94 :: PgVersion -pgVersion94 = PgVersion 90400 "9.4" +minimumPgVersion = pgVersion95 pgVersion95 :: PgVersion pgVersion95 = PgVersion 90500 "9.5" diff --git a/test/Feature/RpcSpec.hs b/test/Feature/RpcSpec.hs index e4728fb14..eb95bd6fd 100644 --- a/test/Feature/RpcSpec.hs +++ b/test/Feature/RpcSpec.hs @@ -12,8 +12,7 @@ import Test.Hspec.Wai.JSON import Text.Heredoc import PostgREST.Types (PgVersion, pgVersion100, pgVersion109, - pgVersion110, pgVersion112, pgVersion114, - pgVersion95) + pgVersion110, pgVersion112, pgVersion114) import Protolude hiding (get) import SpecHelper @@ -101,16 +100,11 @@ spec actualPgVersion = get "/rpc/sayhello?any_arg=value" `shouldRespondWith` 404 it "should not ignore unknown args and fail with 404" $ get "/rpc/add_them?a=1&b=2&smthelse=blabla" `shouldRespondWith` - let - message :: Text - message - | actualPgVersion < pgVersion95 = "function test.add_them(a := integer, b := integer, smthelse := text) does not exist" - | otherwise = "function test.add_them(a => integer, b => integer, smthelse => text) does not exist" - in [json| { + [json| { "code": "42883", "details": null, "hint": "No function matches the given name and argument types. You might need to add explicit type casts.", - "message": #{message} } |] + "message": "function test.add_them(a => integer, b => integer, smthelse => text) does not exist" } |] { matchStatus = 404 , matchHeaders = [matchContentTypeJson] } diff --git a/test/Main.hs b/test/Main.hs index fc6f10f60..200fd27fc 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -15,7 +15,7 @@ import Test.Hspec import PostgREST.App (postgrest) import PostgREST.Config (AppConfig (..)) import PostgREST.DbStructure (getDbStructure, getPgVersion) -import PostgREST.Types (LogLevel (..), pgVersion95, pgVersion96) +import PostgREST.Types (LogLevel (..), pgVersion96) import Protolude hiding (toList, toS) import Protolude.Conv (toS) import SpecHelper @@ -98,10 +98,6 @@ main = do analyzeTable testDbConn "items" analyzeTable testDbConn "child_entities" - extraSpecs = - [("Feature.UpsertSpec", Feature.UpsertSpec.spec) | actualPgVersion >= pgVersion95] ++ - [("Feature.PgVersion95Spec", Feature.PgVersion95Spec.spec) | actualPgVersion >= pgVersion95] - specs = uncurry describe <$> [ ("Feature.AuthSpec" , Feature.AuthSpec.spec actualPgVersion) , ("Feature.RawOutputTypesSpec" , Feature.RawOutputTypesSpec.spec) @@ -113,7 +109,9 @@ main = do , ("Feature.RpcSpec" , Feature.RpcSpec.spec actualPgVersion) , ("Feature.StructureSpec" , Feature.StructureSpec.spec) , ("Feature.AndOrParamsSpec" , Feature.AndOrParamsSpec.spec actualPgVersion) - ] ++ extraSpecs + , ("Feature.UpsertSpec" , Feature.UpsertSpec.spec) + , ("Feature.PgVersion95Spec" , Feature.PgVersion95Spec.spec) + ] mutSpecs = uncurry describe <$> [ ("Feature.DeleteSpec" , Feature.DeleteSpec.spec)