forked from huawei/openGauss-server
support CreateDomainStmt for openGauss
This commit is contained in:
parent
3ac101d466
commit
f9a294bc2e
|
@ -5720,8 +5720,10 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
|
|||
* ******************************** DOMAIN statements ****
|
||||
*/
|
||||
case T_CreateDomainStmt:
|
||||
#ifdef ENABLE_MULTIPLE_NODES
|
||||
if (!IsInitdb && !u_sess->attr.attr_common.IsInplaceUpgrade)
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));
|
||||
#endif
|
||||
DefineDomain((CreateDomainStmt*)parse_tree);
|
||||
#ifdef PGXC
|
||||
if (IS_PGXC_COORDINATOR)
|
||||
|
|
|
@ -58,9 +58,7 @@ ERROR: type "test_domain_exists" does not exist
|
|||
DROP DOMAIN IF EXISTS test_domain_exists;
|
||||
NOTICE: type "test_domain_exists" does not exist, skipping
|
||||
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;
|
||||
NOTICE: type "test_domain_exists" does not exist, skipping
|
||||
DROP DOMAIN test_domain_exists;
|
||||
ERROR: type "test_domain_exists" does not exist
|
||||
---
|
||||
|
|
|
@ -473,25 +473,15 @@ INSERT INTO gtest23q VALUES (2, 5); -- error
|
|||
ERROR: insert or update on table "gtest23q" violates foreign key constraint "gtest23q_b_fkey"
|
||||
DETAIL: Key (b)=(5) is not present in table "gtest23p".
|
||||
DROP TABLE gtest23q;
|
||||
-- domains (domain is not yet supported.)
|
||||
-- domains
|
||||
CREATE DOMAIN gtestdomain1 AS int CHECK (VALUE < 10);
|
||||
ERROR: domain is not yet supported.
|
||||
CREATE TABLE gtest24 (a int PRIMARY KEY, b gtestdomain1 GENERATED ALWAYS AS (a * 2) STORED);
|
||||
ERROR: type "gtestdomain1" does not exist
|
||||
LINE 1: CREATE TABLE gtest24 (a int PRIMARY KEY, b gtestdomain1 GENE...
|
||||
^
|
||||
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "gtest24_pkey" for table "gtest24"
|
||||
INSERT INTO gtest24 (a) VALUES (4); -- ok
|
||||
ERROR: relation "gtest24" does not exist on datanode1
|
||||
LINE 1: INSERT INTO gtest24 (a) VALUES (4);
|
||||
^
|
||||
INSERT INTO gtest24 (a) VALUES (6); -- error
|
||||
ERROR: relation "gtest24" does not exist on datanode1
|
||||
LINE 1: INSERT INTO gtest24 (a) VALUES (6);
|
||||
^
|
||||
ERROR: value for domain gtestdomain1 violates check constraint "gtestdomain1_check"
|
||||
DROP TABLE gtest24;
|
||||
ERROR: table "gtest24" does not exist
|
||||
DROP DOMAIN gtestdomain1;
|
||||
ERROR: type "gtestdomain1" does not exist
|
||||
-- typed tables (currently not supported)
|
||||
CREATE TYPE gtest_type AS (f1 integer, f2 text, f3 bigint);
|
||||
CREATE TABLE gtest28 OF gtest_type (f1 WITH OPTIONS GENERATED ALWAYS AS (f2 *2) STORED);
|
||||
|
|
|
@ -266,7 +266,7 @@ INSERT INTO gtest23q VALUES (2, 5); -- error
|
|||
|
||||
DROP TABLE gtest23q;
|
||||
|
||||
-- domains (domain is not yet supported.)
|
||||
-- domains
|
||||
CREATE DOMAIN gtestdomain1 AS int CHECK (VALUE < 10);
|
||||
CREATE TABLE gtest24 (a int PRIMARY KEY, b gtestdomain1 GENERATED ALWAYS AS (a * 2) STORED);
|
||||
INSERT INTO gtest24 (a) VALUES (4); -- ok
|
||||
|
|
Loading…
Reference in New Issue