feat: Drop support for pg 9.6

This commit is contained in:
Wolfgang Walther
2024-06-15 17:23:34 +02:00
committed by Wolfgang Walther
parent ec110720dc
commit daa77d17aa
20 changed files with 401 additions and 656 deletions
+5 -7
View File
@@ -680,14 +680,12 @@ INSERT INTO private.films (id, title) VALUES (12,'douze commandements'), (2001,'
TRUNCATE TABLE private.personnages CASCADE;
INSERT INTO private.personnages (film_id, role_id, character) VALUES (12,1,'méchant'), (2001,2,'astronaute');
DO $do$BEGIN
IF (SELECT current_setting('server_version_num')::INT >= 100000) THEN
INSERT INTO test.car_models(name, year) VALUES ('DeLorean',1981);
INSERT INTO test.car_models(name, year) VALUES ('F310-B',1997);
INSERT INTO test.car_models(name, year) VALUES ('Veneno',2013);
INSERT INTO test.car_models(name, year) VALUES ('Murcielago',2001);
END IF;
INSERT INTO test.car_models(name, year) VALUES ('DeLorean',1981);
INSERT INTO test.car_models(name, year) VALUES ('F310-B',1997);
INSERT INTO test.car_models(name, year) VALUES ('Veneno',2013);
INSERT INTO test.car_models(name, year) VALUES ('Murcielago',2001);
DO $do$BEGIN
IF (SELECT current_setting('server_version_num')::INT >= 110000) THEN
INSERT INTO test.car_brands(name) VALUES ('DMC');
INSERT INTO test.car_brands(name) VALUES ('Ferrari');
+1 -7
View File
@@ -41,13 +41,7 @@ GRANT USAGE ON SEQUENCE
, leak_id_seq
TO postgrest_test_anonymous;
DO $do$
BEGIN
IF current_setting('server_version_num')::INT >= 100000 THEN
GRANT USAGE ON SEQUENCE channels_id_seq TO postgrest_test_anonymous;
END IF;
END
$do$;
GRANT USAGE ON SEQUENCE channels_id_seq TO postgrest_test_anonymous;
-- Privileges for non anonymous users
GRANT USAGE ON SCHEMA test TO postgrest_test_author;
+25 -42
View File
@@ -2289,26 +2289,22 @@ create table private.rollen (
);
-- Tables used for testing embedding between partitioned tables
create table test.car_models(
name varchar(64) not null,
year int not null
) partition by list (year);
do $do$begin
-- partitioned tables using the PARTITION syntax are supported from pg v10
if (select current_setting('server_version_num')::int >= 100000) then
create table test.car_models(
name varchar(64) not null,
year int not null
) partition by list (year);
comment on table test.car_models is
$$A partitioned table
comment on table test.car_models is
$$A partitioned table
A test for partitioned tables$$;
create table test.car_models_2021 partition of test.car_models
for values in (2021);
create table test.car_models_default partition of test.car_models
for values in (1981,1997,2001,2013);
end if;
create table test.car_models_2021 partition of test.car_models
for values in (2021);
create table test.car_models_default partition of test.car_models
for values in (1981,1997,2001,2013);
do $do$begin
-- primary keys for partitioned tables are supported from pg v11
if (select current_setting('server_version_num')::int >= 110000) then
create table test.car_brands (
@@ -2492,22 +2488,15 @@ BEGIN
END$$;
-- This view is not used in any requests but just parsed by the pfkSourceColumns query.
-- XMLTABLE is only supported from PG 10 on
DO $do$
BEGIN
IF current_setting('server_version_num')::INT >= 100000 THEN
CREATE VIEW test.xml AS
SELECT *
FROM (SELECT ''::xml AS data) _,
XMLTABLE(
''
PASSING data
COLUMNS id int PATH '@id',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified'
);
END IF;
END
$do$;
CREATE VIEW test.xml AS
SELECT *
FROM (SELECT ''::xml AS data) _,
XMLTABLE(
''
PASSING data
COLUMNS id int PATH '@id',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified'
);
-- https://github.com/PostgREST/postgrest/issues/1543
CREATE TYPE complex AS (
@@ -3277,17 +3266,11 @@ create table test.tbl_w_json(
data json
);
DO $do$
BEGIN
IF current_setting('server_version_num')::INT >= 100000 THEN
CREATE TABLE test.channels (
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
data jsonb DEFAULT '{"foo": "bar"}',
slug text
);
END IF;
END
$do$;
CREATE TABLE test.channels (
id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
data jsonb DEFAULT '{"foo": "bar"}',
slug text
);
CREATE FUNCTION test.is_superuser() RETURNS boolean
LANGUAGE sql