missing code of bd515dfada59bc5e8066b758bb9d564d1be7e405 Fix rename schema bug.

This commit is contained in:
gentle_hu
2022-03-16 19:44:07 +08:00
parent f3c1d59045
commit 05a04c1d9b
3 changed files with 32 additions and 3 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;