Drop support for postgres 9.4
This commit is contained in:
committed by
Steve Chavez
parent
29858b8d0d
commit
719c4abba2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ The PostgREST utilities available in `nix-shell` all have names that begin with
|
||||
[nix-shell]$ postgrest-<tab>
|
||||
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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -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]
|
||||
}
|
||||
|
||||
+4
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user