feat: Drop support for pg 10
This commit is contained in:
committed by
Wolfgang Walther
parent
daa77d17aa
commit
126178642b
Vendored
+20
-37
@@ -1046,19 +1046,14 @@ CREATE FUNCTION setprojects(id_l int, id_h int, name text) RETURNS SETOF project
|
||||
update test.projects set name = $3 WHERE id >= $1 AND id <= $2 returning *;
|
||||
$_$;
|
||||
|
||||
-- domains on tables are only supported from pg 11 on
|
||||
DO $do$BEGIN
|
||||
IF (SELECT current_setting('server_version_num')::INT >= 110000) THEN
|
||||
CREATE DOMAIN projects_domain AS projects;
|
||||
CREATE DOMAIN projects_domain AS projects;
|
||||
|
||||
CREATE FUNCTION getproject_domain(id int) RETURNS SETOF projects_domain
|
||||
LANGUAGE sql
|
||||
STABLE
|
||||
AS $_$
|
||||
SELECT projects::projects_domain FROM test.projects WHERE id = $1;
|
||||
$_$;
|
||||
END IF;
|
||||
END$do$;
|
||||
CREATE FUNCTION getproject_domain(id int) RETURNS SETOF projects_domain
|
||||
LANGUAGE sql
|
||||
STABLE
|
||||
AS $_$
|
||||
SELECT projects::projects_domain FROM test.projects WHERE id = $1;
|
||||
$_$;
|
||||
|
||||
create table images (
|
||||
name text not null,
|
||||
@@ -1119,16 +1114,11 @@ create function test.ret_point_overloaded(x json) returns json as $$
|
||||
select $1;
|
||||
$$ language sql;
|
||||
|
||||
-- domains on composite types are only supported from pg 11 on
|
||||
do $do$begin
|
||||
if (SELECT current_setting('server_version_num')::int >= 110000) then
|
||||
create domain test.composite_domain as test.point_2d;
|
||||
create domain test.composite_domain as test.point_2d;
|
||||
|
||||
create function test.ret_composite_domain() returns test.composite_domain as $$
|
||||
select row(10, 5)::test.composite_domain;
|
||||
$$ language sql;
|
||||
end if;
|
||||
end$do$;
|
||||
create function test.ret_composite_domain() returns test.composite_domain as $$
|
||||
select row(10, 5)::test.composite_domain;
|
||||
$$ language sql;
|
||||
|
||||
create type private.point_3d as (x integer, y integer, z integer);
|
||||
|
||||
@@ -2304,17 +2294,14 @@ create table test.car_models_2021 partition of test.car_models
|
||||
create table test.car_models_default partition of test.car_models
|
||||
for values in (1981,1997,2001,2013);
|
||||
|
||||
create table test.car_brands (
|
||||
name varchar(64) primary key
|
||||
);
|
||||
|
||||
alter table test.car_models add primary key (name, year);
|
||||
alter table test.car_models add column car_brand_name varchar(64) references test.car_brands(name);
|
||||
|
||||
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 (
|
||||
name varchar(64) primary key
|
||||
);
|
||||
|
||||
alter table test.car_models add primary key (name, year);
|
||||
alter table test.car_models add column car_brand_name varchar(64) references test.car_brands(name);
|
||||
end if;
|
||||
|
||||
-- foreign keys referencing partitioned tables are supported from pg v12
|
||||
if (select current_setting('server_version_num')::int >= 120000) then
|
||||
create table test.car_model_sales(
|
||||
@@ -2518,12 +2505,8 @@ create table test.arrays (
|
||||
|
||||
-- This procedure is to confirm that procedures don't show up in the OpenAPI output right now.
|
||||
-- Procedures are not supported, yet.
|
||||
do $do$begin
|
||||
if (select current_setting('server_version_num')::int >= 110000) then
|
||||
CREATE PROCEDURE test.unsupported_proc ()
|
||||
LANGUAGE SQL AS '';
|
||||
end if;
|
||||
end $do$;
|
||||
CREATE PROCEDURE test.unsupported_proc ()
|
||||
LANGUAGE SQL AS '';
|
||||
|
||||
CREATE FUNCTION public.dummy(int) RETURNS int
|
||||
LANGUAGE SQL AS $$ SELECT 1 $$;
|
||||
|
||||
Reference in New Issue
Block a user