forked from huawei/openGauss-server
Fix create/drop domain.
This commit is contained in:
parent
71197d149c
commit
099e530ea1
|
|
@ -3587,7 +3587,8 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
||||||
|
|
||||||
case T_AlterDomainStmt:
|
case T_AlterDomainStmt:
|
||||||
#ifdef PGXC
|
#ifdef PGXC
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));
|
/*Single node support domain feature.*/
|
||||||
|
/* ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));*/
|
||||||
#endif /* PGXC */
|
#endif /* PGXC */
|
||||||
{
|
{
|
||||||
AlterDomainStmt* stmt = (AlterDomainStmt*)parse_tree;
|
AlterDomainStmt* stmt = (AlterDomainStmt*)parse_tree;
|
||||||
|
|
@ -4928,8 +4929,9 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
||||||
*/
|
*/
|
||||||
case T_CreateDomainStmt:
|
case T_CreateDomainStmt:
|
||||||
#ifdef PGXC
|
#ifdef PGXC
|
||||||
if (!IsInitdb && !u_sess->attr.attr_common.IsInplaceUpgrade)
|
/*Single node support domain feature.*/
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));
|
/* if (!IsInitdb && !u_sess->attr.attr_common.IsInplaceUpgrade)
|
||||||
|
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));*/
|
||||||
#endif /* PGXC */
|
#endif /* PGXC */
|
||||||
DefineDomain((CreateDomainStmt*)parse_tree);
|
DefineDomain((CreateDomainStmt*)parse_tree);
|
||||||
#ifdef PGXC
|
#ifdef PGXC
|
||||||
|
|
@ -8564,9 +8566,10 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
|
||||||
case OBJECT_LANGUAGE:
|
case OBJECT_LANGUAGE:
|
||||||
tag = "LANGUAGE";
|
tag = "LANGUAGE";
|
||||||
break;
|
break;
|
||||||
case OBJECT_DOMAIN:
|
/*Single node support domain feature.*/
|
||||||
|
/* case OBJECT_DOMAIN:
|
||||||
tag = "DOMAIN";
|
tag = "DOMAIN";
|
||||||
break;
|
break;*/
|
||||||
case OBJECT_CONVERSION:
|
case OBJECT_CONVERSION:
|
||||||
tag = "CONVERSION";
|
tag = "CONVERSION";
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -294,56 +294,50 @@ drop table p1 cascade;
|
||||||
-- test that operations with a dropped column do not try to reference
|
-- test that operations with a dropped column do not try to reference
|
||||||
-- its datatype
|
-- its datatype
|
||||||
create domain mytype as text;
|
create domain mytype as text;
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
create table foo (f1 text, f2 mytype, f3 text);;
|
create table foo (f1 text, f2 mytype, f3 text);;
|
||||||
ERROR: type "mytype" does not exist
|
|
||||||
LINE 1: create table foo (f1 text, f2 mytype, f3 text);
|
|
||||||
^
|
|
||||||
insert into foo values('bb','cc','dd');
|
insert into foo values('bb','cc','dd');
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
|
||||||
LINE 1: insert into foo values('bb','cc','dd');
|
|
||||||
^
|
|
||||||
select * from foo order by f1;
|
select * from foo order by f1;
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
f1 | f2 | f3
|
||||||
LINE 1: select * from foo order by f1;
|
----+----+----
|
||||||
^
|
bb | cc | dd
|
||||||
|
(1 row)
|
||||||
|
|
||||||
drop domain mytype cascade;
|
drop domain mytype cascade;
|
||||||
ERROR: type "mytype" does not exist
|
NOTICE: drop cascades to table foo column f2
|
||||||
select * from foo order by f1;
|
select * from foo order by f1;
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
f1 | f3
|
||||||
LINE 1: select * from foo order by f1;
|
----+----
|
||||||
^
|
bb | dd
|
||||||
|
(1 row)
|
||||||
|
|
||||||
insert into foo values('qq','rr');
|
insert into foo values('qq','rr');
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
|
||||||
LINE 1: insert into foo values('qq','rr');
|
|
||||||
^
|
|
||||||
select * from foo order by f1;
|
select * from foo order by f1;
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
f1 | f3
|
||||||
LINE 1: select * from foo order by f1;
|
----+----
|
||||||
^
|
bb | dd
|
||||||
|
qq | rr
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
update foo set f3 = 'zz';
|
update foo set f3 = 'zz';
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
|
||||||
LINE 1: update foo set f3 = 'zz';
|
|
||||||
^
|
|
||||||
select * from foo order by f1;
|
select * from foo order by f1;
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
f1 | f3
|
||||||
LINE 1: select * from foo order by f1;
|
----+----
|
||||||
^
|
bb | zz
|
||||||
|
qq | zz
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
select f3,max(f1) from foo group by f3;
|
select f3,max(f1) from foo group by f3;
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
f3 | max
|
||||||
LINE 1: select f3,max(f1) from foo group by f3;
|
----+-----
|
||||||
^
|
zz | qq
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- Simple tests for alter table column type
|
-- Simple tests for alter table column type
|
||||||
delete from foo where f1 = 'qq';
|
delete from foo where f1 = 'qq';
|
||||||
ERROR: relation "foo" does not exist on datanode1
|
|
||||||
LINE 1: delete from foo where f1 = 'qq';
|
|
||||||
^
|
|
||||||
alter table foo alter f1 TYPE integer; -- fails
|
alter table foo alter f1 TYPE integer; -- fails
|
||||||
ERROR: relation "foo" does not exist
|
ERROR: invalid input syntax for integer: "bb"
|
||||||
alter table foo alter f1 TYPE varchar(10);
|
alter table foo alter f1 TYPE varchar(10);
|
||||||
ERROR: relation "foo" does not exist
|
|
||||||
drop table foo;
|
drop table foo;
|
||||||
ERROR: table "foo" does not exist
|
|
||||||
create table anothertab (atcol1 serial8, atcol2 boolean,
|
create table anothertab (atcol1 serial8, atcol2 boolean,
|
||||||
constraint anothertab_chk check (atcol1 <= 3));;
|
constraint anothertab_chk check (atcol1 <= 3));;
|
||||||
NOTICE: CREATE TABLE will create implicit sequence "anothertab_atcol1_seq" for serial column "anothertab.atcol1"
|
NOTICE: CREATE TABLE will create implicit sequence "anothertab_atcol1_seq" for serial column "anothertab.atcol1"
|
||||||
|
|
@ -446,11 +440,8 @@ ERROR: composite type recur1 cannot be made a member of itself
|
||||||
alter table recur1 add column f2 recur1[]; -- fails
|
alter table recur1 add column f2 recur1[]; -- fails
|
||||||
ERROR: composite type recur1 cannot be made a member of itself
|
ERROR: composite type recur1 cannot be made a member of itself
|
||||||
create domain array_of_recur1 as recur1[];
|
create domain array_of_recur1 as recur1[];
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
alter table recur1 add column f2 array_of_recur1; -- fails
|
alter table recur1 add column f2 array_of_recur1; -- fails
|
||||||
ERROR: type "array_of_recur1" does not exist
|
ERROR: composite type recur1 cannot be made a member of itself
|
||||||
LINE 1: alter table recur1 add column f2 array_of_recur1;
|
|
||||||
^
|
|
||||||
create table recur2 (f1 int, f2 recur1);
|
create table recur2 (f1 int, f2 recur1);
|
||||||
alter table recur1 add column f2 recur2; -- fails
|
alter table recur1 add column f2 recur2; -- fails
|
||||||
ERROR: composite type recur1 cannot be made a member of itself
|
ERROR: composite type recur1 cannot be made a member of itself
|
||||||
|
|
@ -649,7 +640,6 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for tab
|
||||||
create view alter1.v1 as select * from alter1.t1;
|
create view alter1.v1 as select * from alter1.t1;
|
||||||
create function alter1.plus1(int) returns int as 'select $1+1' language sql;
|
create function alter1.plus1(int) returns int as 'select $1+1' language sql;
|
||||||
create domain alter1.posint integer check (value > 0);
|
create domain alter1.posint integer check (value > 0);
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
create type alter1.ctype as (f1 int, f2 text);
|
create type alter1.ctype as (f1 int, f2 text);
|
||||||
create function alter1.same(alter1.ctype, alter1.ctype) returns boolean language sql
|
create function alter1.same(alter1.ctype, alter1.ctype) returns boolean language sql
|
||||||
as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
|
as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
|
||||||
|
|
@ -675,7 +665,6 @@ ERROR: There's dependent sequence, but ALTER SEQUENCE SET SCHEMA is not yet sup
|
||||||
alter table alter1.v1 set schema alter2;
|
alter table alter1.v1 set schema alter2;
|
||||||
alter function alter1.plus1(int) set schema alter2;
|
alter function alter1.plus1(int) set schema alter2;
|
||||||
alter domain alter1.posint set schema alter2;
|
alter domain alter1.posint set schema alter2;
|
||||||
ERROR: type "alter1.posint" does not exist
|
|
||||||
alter operator class alter1.ctype_hash_ops using hash set schema alter2;
|
alter operator class alter1.ctype_hash_ops using hash set schema alter2;
|
||||||
ERROR: operator class "alter1.ctype_hash_ops" does not exist for access method "hash"
|
ERROR: operator class "alter1.ctype_hash_ops" does not exist for access method "hash"
|
||||||
alter operator family alter1.ctype_hash_ops using hash set schema alter2;
|
alter operator family alter1.ctype_hash_ops using hash set schema alter2;
|
||||||
|
|
@ -727,9 +716,10 @@ select alter2.plus1(41);
|
||||||
|
|
||||||
-- clean up
|
-- clean up
|
||||||
drop schema alter2 cascade;
|
drop schema alter2 cascade;
|
||||||
NOTICE: drop cascades to 4 other objects
|
NOTICE: drop cascades to 5 other objects
|
||||||
DETAIL: drop cascades to view alter2.v1
|
DETAIL: drop cascades to view alter2.v1
|
||||||
drop cascades to function alter2.plus1(integer)
|
drop cascades to function alter2.plus1(integer)
|
||||||
|
drop cascades to type alter2.posint
|
||||||
drop cascades to type alter2.ctype
|
drop cascades to type alter2.ctype
|
||||||
drop cascades to function alter2.same(alter2.ctype,alter2.ctype)
|
drop cascades to function alter2.same(alter2.ctype,alter2.ctype)
|
||||||
drop schema alter1 cascade;
|
drop schema alter1 cascade;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ select count(*) from pg_node_env;
|
||||||
select count(*) from pg_os_threads;
|
select count(*) from pg_os_threads;
|
||||||
count
|
count
|
||||||
-------
|
-------
|
||||||
29
|
10
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- test backtrace output to log
|
-- test backtrace output to log
|
||||||
|
|
|
||||||
|
|
@ -71,39 +71,36 @@ ERROR: collation mismatch between explicit collations "C" and "POSIX"
|
||||||
LINE 1: ...* FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "P...
|
LINE 1: ...* FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "P...
|
||||||
^
|
^
|
||||||
CREATE DOMAIN testdomain_p AS text COLLATE "POSIX";
|
CREATE DOMAIN testdomain_p AS text COLLATE "POSIX";
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
CREATE DOMAIN testdomain_i AS int COLLATE "POSIX"; -- fail
|
CREATE DOMAIN testdomain_i AS int COLLATE "POSIX"; -- fail
|
||||||
ERROR: domain is not yet supported.
|
ERROR: collations are not supported by type integer
|
||||||
CREATE TABLE collate_test4 (
|
CREATE TABLE collate_test4 (
|
||||||
a int,
|
a int,
|
||||||
b testdomain_p
|
b testdomain_p
|
||||||
);
|
);
|
||||||
ERROR: type "testdomain_p" does not exist
|
|
||||||
LINE 3: b testdomain_p
|
|
||||||
^
|
|
||||||
INSERT INTO collate_test4 SELECT * FROM collate_test1;
|
INSERT INTO collate_test4 SELECT * FROM collate_test1;
|
||||||
ERROR: relation "collate_test4" does not exist on datanode1
|
|
||||||
LINE 1: INSERT INTO collate_test4 SELECT * FROM collate_test1;
|
|
||||||
^
|
|
||||||
SELECT a, b FROM collate_test4 ORDER BY b;
|
SELECT a, b FROM collate_test4 ORDER BY b;
|
||||||
ERROR: relation "collate_test4" does not exist on datanode1
|
a | b
|
||||||
LINE 1: SELECT a, b FROM collate_test4 ORDER BY b;
|
---+-----
|
||||||
^
|
4 | ABD
|
||||||
|
2 | Abc
|
||||||
|
1 | abc
|
||||||
|
3 | bbc
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
CREATE TABLE collate_test5 (
|
CREATE TABLE collate_test5 (
|
||||||
a int,
|
a int,
|
||||||
b testdomain_p COLLATE "C"
|
b testdomain_p COLLATE "C"
|
||||||
);
|
);
|
||||||
ERROR: type "testdomain_p" does not exist
|
|
||||||
LINE 3: b testdomain_p COLLATE "C"
|
|
||||||
^
|
|
||||||
INSERT INTO collate_test5 SELECT * FROM collate_test1;
|
INSERT INTO collate_test5 SELECT * FROM collate_test1;
|
||||||
ERROR: relation "collate_test5" does not exist on datanode1
|
|
||||||
LINE 1: INSERT INTO collate_test5 SELECT * FROM collate_test1;
|
|
||||||
^
|
|
||||||
SELECT a, b FROM collate_test5 ORDER BY b;
|
SELECT a, b FROM collate_test5 ORDER BY b;
|
||||||
ERROR: relation "collate_test5" does not exist on datanode1
|
a | b
|
||||||
LINE 1: SELECT a, b FROM collate_test5 ORDER BY b;
|
---+-----
|
||||||
^
|
4 | ABD
|
||||||
|
2 | Abc
|
||||||
|
1 | abc
|
||||||
|
3 | bbc
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
SELECT a, b FROM collate_test1 ORDER BY b;
|
SELECT a, b FROM collate_test1 ORDER BY b;
|
||||||
a | b
|
a | b
|
||||||
---+-----
|
---+-----
|
||||||
|
|
@ -299,27 +296,40 @@ SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test2 ORDER BY 2
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
CREATE DOMAIN testdomain AS text;
|
CREATE DOMAIN testdomain AS text;
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
|
SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
|
||||||
ERROR: type "testdomain" does not exist
|
a | b
|
||||||
LINE 1: SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
|
---+-----
|
||||||
^
|
4 | ABD
|
||||||
CONTEXT: referenced column: b
|
2 | Abc
|
||||||
|
1 | abc
|
||||||
|
3 | bbc
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
SELECT a, b::testdomain FROM collate_test2 ORDER BY 2;
|
SELECT a, b::testdomain FROM collate_test2 ORDER BY 2;
|
||||||
ERROR: type "testdomain" does not exist
|
a | b
|
||||||
LINE 1: SELECT a, b::testdomain FROM collate_test2 ORDER BY 2;
|
---+-----
|
||||||
^
|
4 | ABD
|
||||||
CONTEXT: referenced column: b
|
2 | Abc
|
||||||
|
1 | abc
|
||||||
|
3 | bbc
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
SELECT a, b::testdomain_p FROM collate_test2 ORDER BY 2;
|
SELECT a, b::testdomain_p FROM collate_test2 ORDER BY 2;
|
||||||
ERROR: type "testdomain_p" does not exist
|
a | b
|
||||||
LINE 1: SELECT a, b::testdomain_p FROM collate_test2 ORDER BY 2;
|
---+-----
|
||||||
^
|
4 | ABD
|
||||||
CONTEXT: referenced column: b
|
2 | Abc
|
||||||
|
1 | abc
|
||||||
|
3 | bbc
|
||||||
|
(4 rows)
|
||||||
|
|
||||||
SELECT a, lower(x::testdomain), lower(y::testdomain) FROM collate_test10 ORDER BY 1, 2, 3;
|
SELECT a, lower(x::testdomain), lower(y::testdomain) FROM collate_test10 ORDER BY 1, 2, 3;
|
||||||
ERROR: type "testdomain" does not exist
|
a | lower | lower
|
||||||
LINE 1: SELECT a, lower(x::testdomain), lower(y::testdomain) FROM co...
|
---+-------+-------
|
||||||
^
|
1 | hij | hij
|
||||||
CONTEXT: referenced column: lower
|
2 | hij | hij
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
SELECT min(b), max(b) FROM collate_test1;
|
SELECT min(b), max(b) FROM collate_test1;
|
||||||
min | max
|
min | max
|
||||||
-----+-----
|
-----+-----
|
||||||
|
|
@ -608,14 +618,18 @@ explain (verbose, costs off, nodes off) SELECT collation for ((SELECT b FROM col
|
||||||
-- must get rid of them.
|
-- must get rid of them.
|
||||||
--
|
--
|
||||||
DROP SCHEMA collate_tests CASCADE;
|
DROP SCHEMA collate_tests CASCADE;
|
||||||
NOTICE: drop cascades to 11 other objects
|
NOTICE: drop cascades to 15 other objects
|
||||||
DETAIL: drop cascades to table collate_test1
|
DETAIL: drop cascades to table collate_test1
|
||||||
drop cascades to table collate_test_like
|
drop cascades to table collate_test_like
|
||||||
drop cascades to table collate_test2
|
drop cascades to table collate_test2
|
||||||
|
drop cascades to type testdomain_p
|
||||||
|
drop cascades to table collate_test4
|
||||||
|
drop cascades to table collate_test5
|
||||||
drop cascades to table collate_test10
|
drop cascades to table collate_test10
|
||||||
drop cascades to view collview1
|
drop cascades to view collview1
|
||||||
drop cascades to view collview2
|
drop cascades to view collview2
|
||||||
drop cascades to view collview3
|
drop cascades to view collview3
|
||||||
|
drop cascades to type testdomain
|
||||||
drop cascades to function dup(anyelement)
|
drop cascades to function dup(anyelement)
|
||||||
drop cascades to table collate_test20
|
drop cascades to table collate_test20
|
||||||
drop cascades to table collate_test21
|
drop cascades to table collate_test21
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,7 @@ ERROR: type "test_domain_exists" does not exist
|
||||||
DROP DOMAIN IF EXISTS test_domain_exists;
|
DROP DOMAIN IF EXISTS test_domain_exists;
|
||||||
NOTICE: type "test_domain_exists" does not exist, skipping
|
NOTICE: type "test_domain_exists" does not exist, skipping
|
||||||
CREATE domain test_domain_exists as int not null check (value > 0);
|
CREATE domain test_domain_exists as int not null check (value > 0);
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
DROP DOMAIN IF EXISTS test_domain_exists;
|
DROP DOMAIN IF EXISTS test_domain_exists;
|
||||||
NOTICE: type "test_domain_exists" does not exist, skipping
|
|
||||||
DROP DOMAIN test_domain_exists;
|
DROP DOMAIN test_domain_exists;
|
||||||
ERROR: type "test_domain_exists" does not exist
|
ERROR: type "test_domain_exists" does not exist
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -402,24 +402,19 @@ RESET enable_bitmapscan;
|
||||||
-- Domains over enums
|
-- Domains over enums
|
||||||
--
|
--
|
||||||
CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue'));
|
CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue'));
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
SELECT 'red'::rgb;
|
SELECT 'red'::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
rgb
|
||||||
LINE 1: SELECT 'red'::rgb;
|
-----
|
||||||
^
|
red
|
||||||
CONTEXT: referenced column: rgb
|
(1 row)
|
||||||
|
|
||||||
SELECT 'purple'::rgb;
|
SELECT 'purple'::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
ERROR: value for domain rgb violates check constraint "rgb_check"
|
||||||
LINE 1: SELECT 'purple'::rgb;
|
|
||||||
^
|
|
||||||
CONTEXT: referenced column: rgb
|
CONTEXT: referenced column: rgb
|
||||||
SELECT 'purple'::rainbow::rgb;
|
SELECT 'purple'::rainbow::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
ERROR: value for domain rgb violates check constraint "rgb_check"
|
||||||
LINE 1: SELECT 'purple'::rainbow::rgb;
|
|
||||||
^
|
|
||||||
CONTEXT: referenced column: rgb
|
CONTEXT: referenced column: rgb
|
||||||
DROP DOMAIN rgb;
|
DROP DOMAIN rgb;
|
||||||
ERROR: type "rgb" does not exist
|
|
||||||
--
|
--
|
||||||
-- Arrays
|
-- Arrays
|
||||||
--
|
--
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ select * from gtt6;
|
||||||
|
|
||||||
-- ERROR
|
-- ERROR
|
||||||
create index CONCURRENTLY idx_gtt1 on gtt1 (b);
|
create index CONCURRENTLY idx_gtt1 on gtt1 (b);
|
||||||
|
ERROR: PGXC does not support concurrent INDEX yet
|
||||||
|
DETAIL: The feature is not currently supported
|
||||||
-- ERROR
|
-- ERROR
|
||||||
cluster gtt1 using gtt1_pkey;
|
cluster gtt1 using gtt1_pkey;
|
||||||
-- ERROR
|
-- ERROR
|
||||||
|
|
|
||||||
|
|
@ -3230,15 +3230,15 @@ INSERT INTO c VALUES (0), (1);
|
||||||
INSERT INTO d VALUES (1,3), (2,2), (3,1);
|
INSERT INTO d VALUES (1,3), (2,2), (3,1);
|
||||||
-- all three cases should be optimizable into a simple seqscan
|
-- all three cases should be optimizable into a simple seqscan
|
||||||
explain (verbose on, costs off, nodes off) SELECT a.* FROM a LEFT JOIN b ON a.b_id = b.id;
|
explain (verbose on, costs off, nodes off) SELECT a.* FROM a LEFT JOIN b ON a.b_id = b.id;
|
||||||
QUERY PLAN
|
--?.*QUERY PLAN.*
|
||||||
----------------------------------------
|
--?----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: a.id, a.b_id
|
Output: a.id, a.b_id
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
explain (verbose on, costs off, nodes off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
|
explain (verbose on, costs off, nodes off) SELECT b.* FROM b LEFT JOIN c ON b.c_id = c.id;
|
||||||
QUERY PLAN
|
--?.*QUERY PLAN.*
|
||||||
----------------------------------------
|
--?----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: b.id, b.c_id
|
Output: b.id, b.c_id
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3246,8 +3246,8 @@ explain (verbose on, costs off, nodes off) SELECT b.* FROM b LEFT JOIN c ON b.c_
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
|
SELECT a.* FROM a LEFT JOIN (b left join c on b.c_id = c.id)
|
||||||
ON (a.b_id = b.id);
|
ON (a.b_id = b.id);
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------
|
--?-----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: a.id, a.b_id
|
Output: a.id, a.b_id
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3257,8 +3257,8 @@ explain (verbose on, costs off, nodes off)
|
||||||
select id from a where id in (
|
select id from a where id in (
|
||||||
select b.id from b left join c on b.id = c.id
|
select b.id from b left join c on b.id = c.id
|
||||||
);
|
);
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------------------
|
--?----------------------------.*
|
||||||
Hash Join
|
Hash Join
|
||||||
Output: a.id
|
Output: a.id
|
||||||
Hash Cond: (a.id = b.id)
|
Hash Cond: (a.id = b.id)
|
||||||
|
|
@ -3275,8 +3275,8 @@ select id from a where id in (
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select d.* from d left join (select * from b group by b.id, b.c_id) s
|
select d.* from d left join (select * from b group by b.id, b.c_id) s
|
||||||
on d.a = s.id and d.b = s.c_id;
|
on d.a = s.id and d.b = s.c_id;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------
|
--?----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: d.a, d.b
|
Output: d.a, d.b
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3285,8 +3285,8 @@ select d.* from d left join (select * from b group by b.id, b.c_id) s
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select d.* from d left join (select distinct * from b) s
|
select d.* from d left join (select distinct * from b) s
|
||||||
on d.a = s.id and d.b = s.c_id;
|
on d.a = s.id and d.b = s.c_id;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------
|
--?----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: d.a, d.b
|
Output: d.a, d.b
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3296,8 +3296,8 @@ select d.* from d left join (select distinct * from b) s
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select d.* from d left join (select * from b group by b.id, b.c_id) s
|
select d.* from d left join (select * from b group by b.id, b.c_id) s
|
||||||
on d.a = s.id;
|
on d.a = s.id;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------------------
|
--?----------------------------.*
|
||||||
Hash Right Join
|
Hash Right Join
|
||||||
Output: d.a, d.b
|
Output: d.a, d.b
|
||||||
Hash Cond: (b.id = d.a)
|
Hash Cond: (b.id = d.a)
|
||||||
|
|
@ -3316,8 +3316,8 @@ select d.* from d left join (select * from b group by b.id, b.c_id) s
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select d.* from d left join (select distinct * from b) s
|
select d.* from d left join (select distinct * from b) s
|
||||||
on d.a = s.id;
|
on d.a = s.id;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------------------
|
--?----------------------------.*
|
||||||
Hash Right Join
|
Hash Right Join
|
||||||
Output: d.a, d.b
|
Output: d.a, d.b
|
||||||
Hash Cond: (b.id = d.a)
|
Hash Cond: (b.id = d.a)
|
||||||
|
|
@ -3337,8 +3337,8 @@ select d.* from d left join (select distinct * from b) s
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select d.* from d left join (select id from a union select id from b) s
|
select d.* from d left join (select id from a union select id from b) s
|
||||||
on d.a = s.id;
|
on d.a = s.id;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------
|
--?----------------------------.*
|
||||||
--? Seq Scan on pg_temp_datanod.*
|
--? Seq Scan on pg_temp_datanod.*
|
||||||
Output: d.a, d.b
|
Output: d.a, d.b
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3347,8 +3347,8 @@ select d.* from d left join (select id from a union select id from b) s
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select i8.* from int8_tbl i8 left join (select f1 from int4_tbl group by f1) i4
|
select i8.* from int8_tbl i8 left join (select f1 from int4_tbl group by f1) i4
|
||||||
on i8.q1 = i4.f1;
|
on i8.q1 = i4.f1;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
--------------------------------
|
--?----------------------------.*
|
||||||
Seq Scan on public.int8_tbl i8
|
Seq Scan on public.int8_tbl i8
|
||||||
Output: i8.q1, i8.q2
|
Output: i8.q1, i8.q2
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
@ -3371,8 +3371,8 @@ select p.* from parent p left join child c on (p.k = c.k) order by 1,2;
|
||||||
|
|
||||||
explain (verbose on, costs off, nodes off)
|
explain (verbose on, costs off, nodes off)
|
||||||
select p.* from parent p left join child c on (p.k = c.k) order by 1,2;
|
select p.* from parent p left join child c on (p.k = c.k) order by 1,2;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
-----------------------------------------------------
|
--?----------------------------.*
|
||||||
Sort
|
Sort
|
||||||
Output: p.k, p.pd
|
Output: p.k, p.pd
|
||||||
Sort Key: p.k, p.pd
|
Sort Key: p.k, p.pd
|
||||||
|
|
@ -3395,8 +3395,8 @@ explain (verbose on, costs off, nodes off)
|
||||||
select p.*, linked from parent p
|
select p.*, linked from parent p
|
||||||
left join (select c.*, true as linked from child c) as ss
|
left join (select c.*, true as linked from child c) as ss
|
||||||
on (p.k = ss.k) order by p.k;
|
on (p.k = ss.k) order by p.k;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
-----------------------------------------------------------------------------
|
--?----------------------------.*
|
||||||
Merge Left Join
|
Merge Left Join
|
||||||
Output: p.k, p.pd, (true)
|
Output: p.k, p.pd, (true)
|
||||||
Merge Cond: (p.k = c.k)
|
Merge Cond: (p.k = c.k)
|
||||||
|
|
@ -3418,8 +3418,8 @@ explain (verbose on, costs off, nodes off)
|
||||||
select p.* from
|
select p.* from
|
||||||
parent p left join child c on (p.k = c.k)
|
parent p left join child c on (p.k = c.k)
|
||||||
where p.k = 1 and p.k = 2;
|
where p.k = 1 and p.k = 2;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
--------------------------
|
--?----------------.*
|
||||||
Result
|
Result
|
||||||
Output: p.k, p.pd
|
Output: p.k, p.pd
|
||||||
One-Time Filter: false
|
One-Time Filter: false
|
||||||
|
|
@ -3519,8 +3519,8 @@ select t1.* from
|
||||||
on (t1.f1 = b1.d1)
|
on (t1.f1 = b1.d1)
|
||||||
left join int4_tbl i4
|
left join int4_tbl i4
|
||||||
on (i8.q2 = i4.f1);
|
on (i8.q2 = i4.f1);
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------------------------------------
|
--?----------------------------.*
|
||||||
Hash Left Join
|
Hash Left Join
|
||||||
Output: t1.f1
|
Output: t1.f1
|
||||||
Hash Cond: (i8.q2 = i4.f1)
|
Hash Cond: (i8.q2 = i4.f1)
|
||||||
|
|
@ -3586,8 +3586,8 @@ select t1.* from
|
||||||
on (t1.f1 = b1.d1)
|
on (t1.f1 = b1.d1)
|
||||||
left join int4_tbl i4
|
left join int4_tbl i4
|
||||||
on (i8.q2 = i4.f1);
|
on (i8.q2 = i4.f1);
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
----------------------------------------------------------------------
|
--?----------------------------.*
|
||||||
Hash Left Join
|
Hash Left Join
|
||||||
Output: t1.f1
|
Output: t1.f1
|
||||||
Hash Cond: (i8.q2 = i4.f1)
|
Hash Cond: (i8.q2 = i4.f1)
|
||||||
|
|
@ -3652,8 +3652,8 @@ select * from
|
||||||
on t1.f1 = 'doh!'
|
on t1.f1 = 'doh!'
|
||||||
left join int4_tbl i4
|
left join int4_tbl i4
|
||||||
on i8.q1 = i4.f1;
|
on i8.q1 = i4.f1;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
--------------------------------------------------------------
|
--?----------------------------.*
|
||||||
Nested Loop Left Join
|
Nested Loop Left Join
|
||||||
Output: t1.f1, i8.q1, i8.q2, t2.f1, i4.f1
|
Output: t1.f1, i8.q1, i8.q2, t2.f1, i4.f1
|
||||||
-> Seq Scan on public.text_tbl t2
|
-> Seq Scan on public.text_tbl t2
|
||||||
|
|
@ -3700,8 +3700,8 @@ CREATE TABLE mj_t2 (a int,c char(10));
|
||||||
insert into mj_t2 values(12,'abcde');
|
insert into mj_t2 values(12,'abcde');
|
||||||
insert into mj_t2 values(12,'efghi');
|
insert into mj_t2 values(12,'efghi');
|
||||||
explain (nodes off, costs off) select * from mj_t1 full outer join mj_t2 on 1=1;
|
explain (nodes off, costs off) select * from mj_t1 full outer join mj_t2 on 1=1;
|
||||||
QUERY PLAN
|
--?QUERY PLAN.*
|
||||||
-------------------------------
|
--?-----------------------.*
|
||||||
Merge Full Join
|
Merge Full Join
|
||||||
-> Seq Scan on mj_t1
|
-> Seq Scan on mj_t1
|
||||||
-> Materialize
|
-> Materialize
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ SELECT name, setting FROM pg_settings WHERE name LIKE 'enable%' ORDER BY name;
|
||||||
enable_sonic_optspill | on
|
enable_sonic_optspill | on
|
||||||
enable_sort | on
|
enable_sort | on
|
||||||
enable_stream_replication | on
|
enable_stream_replication | on
|
||||||
enable_thread_pool | on
|
enable_thread_pool | off
|
||||||
enable_tidscan | on
|
enable_tidscan | on
|
||||||
enable_upgrade_merge_lock_mode | off
|
enable_upgrade_merge_lock_mode | off
|
||||||
enable_user_metric_persistent | on
|
enable_user_metric_persistent | on
|
||||||
|
|
|
||||||
|
|
@ -380,24 +380,19 @@ RESET enable_bitmapscan;
|
||||||
-- Domains over enums
|
-- Domains over enums
|
||||||
--
|
--
|
||||||
CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue'));
|
CREATE DOMAIN rgb AS rainbow CHECK (VALUE IN ('red', 'green', 'blue'));
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
SELECT 'red'::rgb;
|
SELECT 'red'::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
rgb
|
||||||
LINE 1: SELECT 'red'::rgb;
|
-----
|
||||||
^
|
red
|
||||||
CONTEXT: referenced column: rgb
|
(1 row)
|
||||||
|
|
||||||
SELECT 'purple'::rgb;
|
SELECT 'purple'::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
ERROR: value for domain rgb violates check constraint "rgb_check"
|
||||||
LINE 1: SELECT 'purple'::rgb;
|
|
||||||
^
|
|
||||||
CONTEXT: referenced column: rgb
|
CONTEXT: referenced column: rgb
|
||||||
SELECT 'purple'::rainbow::rgb;
|
SELECT 'purple'::rainbow::rgb;
|
||||||
ERROR: type "rgb" does not exist
|
ERROR: value for domain rgb violates check constraint "rgb_check"
|
||||||
LINE 1: SELECT 'purple'::rainbow::rgb;
|
|
||||||
^
|
|
||||||
CONTEXT: referenced column: rgb
|
CONTEXT: referenced column: rgb
|
||||||
DROP DOMAIN rgb;
|
DROP DOMAIN rgb;
|
||||||
ERROR: type "rgb" does not exist
|
|
||||||
--
|
--
|
||||||
-- Arrays
|
-- Arrays
|
||||||
--
|
--
|
||||||
|
|
|
||||||
|
|
@ -897,7 +897,6 @@ ERROR: table "float8range_test" does not exist
|
||||||
-- Test range types over domains
|
-- Test range types over domains
|
||||||
--
|
--
|
||||||
create domain mydomain as int4;
|
create domain mydomain as int4;
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
create type mydomainrange as range(subtype=mydomain);
|
create type mydomainrange as range(subtype=mydomain);
|
||||||
ERROR: user defined range type is not yet supported.
|
ERROR: user defined range type is not yet supported.
|
||||||
select '[4,50)'::mydomainrange @> 7::mydomain;
|
select '[4,50)'::mydomainrange @> 7::mydomain;
|
||||||
|
|
@ -905,24 +904,21 @@ ERROR: type "mydomainrange" does not exist
|
||||||
LINE 1: select '[4,50)'::mydomainrange @> 7::mydomain;
|
LINE 1: select '[4,50)'::mydomainrange @> 7::mydomain;
|
||||||
^
|
^
|
||||||
drop domain mydomain; -- fail
|
drop domain mydomain; -- fail
|
||||||
ERROR: type "mydomain" does not exist
|
|
||||||
drop domain mydomain cascade;
|
drop domain mydomain cascade;
|
||||||
ERROR: type "mydomain" does not exist
|
ERROR: type "mydomain" does not exist
|
||||||
--
|
--
|
||||||
-- Test domains over range types
|
-- Test domains over range types
|
||||||
--
|
--
|
||||||
create domain restrictedrange as int4range check (upper(value) < 10);
|
create domain restrictedrange as int4range check (upper(value) < 10);
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
select '[4,5)'::restrictedrange @> 7;
|
select '[4,5)'::restrictedrange @> 7;
|
||||||
ERROR: type "restrictedrange" does not exist
|
?column?
|
||||||
LINE 1: select '[4,5)'::restrictedrange @> 7;
|
----------
|
||||||
^
|
f
|
||||||
|
(1 row)
|
||||||
|
|
||||||
select '[4,50)'::restrictedrange @> 7; -- should fail
|
select '[4,50)'::restrictedrange @> 7; -- should fail
|
||||||
ERROR: type "restrictedrange" does not exist
|
ERROR: value for domain restrictedrange violates check constraint "restrictedrange_check"
|
||||||
LINE 1: select '[4,50)'::restrictedrange @> 7;
|
|
||||||
^
|
|
||||||
drop domain restrictedrange;
|
drop domain restrictedrange;
|
||||||
ERROR: type "restrictedrange" does not exist
|
|
||||||
--
|
--
|
||||||
-- Test multiple range types over the same subtype
|
-- Test multiple range types over the same subtype
|
||||||
--
|
--
|
||||||
|
|
|
||||||
|
|
@ -3205,7 +3205,6 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for tab
|
||||||
create view alter_llt1.v1 as select * from alter_llt1.t1;
|
create view alter_llt1.v1 as select * from alter_llt1.t1;
|
||||||
create function alter_llt1.plus1(int) returns int as 'select $1+1' language sql;
|
create function alter_llt1.plus1(int) returns int as 'select $1+1' language sql;
|
||||||
create domain alter_llt1.posint integer check (value > 0);
|
create domain alter_llt1.posint integer check (value > 0);
|
||||||
ERROR: domain is not yet supported.
|
|
||||||
create type alter_llt1.ctype as (f1 int, f2 text);
|
create type alter_llt1.ctype as (f1 int, f2 text);
|
||||||
create function alter_llt1.same(alter_llt1.ctype, alter_llt1.ctype) returns boolean language sql
|
create function alter_llt1.same(alter_llt1.ctype, alter_llt1.ctype) returns boolean language sql
|
||||||
as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
|
as 'select $1.f1 is not distinct from $2.f1 and $1.f2 is not distinct from $2.f2';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue