diff --git a/src/common/backend/utils/adt/ruleutils.cpp b/src/common/backend/utils/adt/ruleutils.cpp index d7d5781c4..6262f3d38 100644 --- a/src/common/backend/utils/adt/ruleutils.cpp +++ b/src/common/backend/utils/adt/ruleutils.cpp @@ -3806,7 +3806,7 @@ static text* pg_get_expr_worker(text* expr, Oid relid, const char* relname, int exprstr = text_to_cstring(expr); /* Convert expression to node tree */ - node = (Node*)stringToNode(exprstr); + node = (Node*)stringToNode_skip_extern_fields(exprstr); pfree_ext(exprstr); diff --git a/src/test/regress/expected/create_schema.out b/src/test/regress/expected/create_schema.out index c6bb2acce..2bb81aa76 100644 --- a/src/test/regress/expected/create_schema.out +++ b/src/test/regress/expected/create_schema.out @@ -1,9 +1,34 @@ create role samedb_schema_cn_role_02_001 password 'Ttest_234'; create schema authorization samedb_schema_cn_role_02_001 -create table samedb_schema_cn_role_02_001.cn_table_00 (cn_a int, cn_b text , cn_c date ,cn_d interval) +create table samedb_schema_cn_role_02_001.cn_table_00 (cn_a int, cn_b text , cn_c date ,cn_d interval, cn_e serial) create view cn_view_00 as select cn_b,cn_d, cn_c from cn_table_00; +NOTICE: CREATE TABLE will create implicit sequence "cn_table_00_cn_e_seq" for serial column "cn_table_00.cn_e" +\d+ samedb_schema_cn_role_02_001.cn_table_00 + Table "samedb_schema_cn_role_02_001.cn_table_00" + Column | Type | Modifiers | Storage | Stats target | Description +--------+--------------------------------+-----------------------------------------------------------------------------------------+----------+--------------+------------- + cn_a | integer | | plain | | + cn_b | text | | extended | | + cn_c | timestamp(0) without time zone | | plain | | + cn_d | interval | | plain | | + cn_e | integer | not null default nextval('samedb_schema_cn_role_02_001.cn_table_00_cn_e_seq'::regclass) | plain | | +Has OIDs: no +Options: orientation=row, compression=no + alter schema samedb_schema_cn_role_02_001 rename to samedb_schema_cn_role_02_001_bak; +\d+ samedb_schema_cn_role_02_001_bak.cn_table_00 + Table "samedb_schema_cn_role_02_001_bak.cn_table_00" + Column | Type | Modifiers | Storage | Stats target | Description +--------+--------------------------------+---------------------------------------------------------------------------------------------+----------+--------------+------------- + cn_a | integer | | plain | | + cn_b | text | | extended | | + cn_c | timestamp(0) without time zone | | plain | | + cn_d | interval | | plain | | + cn_e | integer | not null default nextval('samedb_schema_cn_role_02_001_bak.cn_table_00_cn_e_seq'::regclass) | plain | | +Has OIDs: no +Options: orientation=row, compression=no + alter view samedb_schema_cn_role_02_001_bak.cn_view_00 rename to cn_view_00_bak; drop view samedb_schema_cn_role_02_001_bak.cn_view_00_bak; drop table samedb_schema_cn_role_02_001_bak.cn_table_00; diff --git a/src/test/regress/sql/create_schema.sql b/src/test/regress/sql/create_schema.sql index 7b22d8011..6c41d0c44 100644 --- a/src/test/regress/sql/create_schema.sql +++ b/src/test/regress/sql/create_schema.sql @@ -1,12 +1,16 @@ create role samedb_schema_cn_role_02_001 password 'Ttest_234'; create schema authorization samedb_schema_cn_role_02_001 -create table samedb_schema_cn_role_02_001.cn_table_00 (cn_a int, cn_b text , cn_c date ,cn_d interval) +create table samedb_schema_cn_role_02_001.cn_table_00 (cn_a int, cn_b text , cn_c date ,cn_d interval, cn_e serial) create view cn_view_00 as select cn_b,cn_d, cn_c from cn_table_00; +\d+ samedb_schema_cn_role_02_001.cn_table_00 + alter schema samedb_schema_cn_role_02_001 rename to samedb_schema_cn_role_02_001_bak; +\d+ samedb_schema_cn_role_02_001_bak.cn_table_00 + alter view samedb_schema_cn_role_02_001_bak.cn_view_00 rename to cn_view_00_bak; drop view samedb_schema_cn_role_02_001_bak.cn_view_00_bak;