citus/src/test/regress/expected/upgrade_autoconverted_befor...

45 lines
1.6 KiB
Plaintext

CREATE TABLE ref_not_autoconverted(a int unique);
CREATE TABLE citus_local_autoconverted(a int unique references ref_not_autoconverted(a));
CREATE TABLE citus_local_not_autoconverted(a int unique);
select create_reference_table('ref_not_autoconverted');
create_reference_table
---------------------------------------------------------------------
(1 row)
select citus_add_local_table_to_metadata('citus_local_not_autoconverted');
citus_add_local_table_to_metadata
---------------------------------------------------------------------
(1 row)
select logicalrelid, autoconverted from pg_dist_partition
where logicalrelid IN ('citus_local_autoconverted'::regclass,
'citus_local_not_autoconverted'::regclass);
logicalrelid | autoconverted
---------------------------------------------------------------------
citus_local_autoconverted | t
citus_local_not_autoconverted | f
(2 rows)
CREATE EXTENSION postgres_fdw;
CREATE SERVER foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'localhost', dbname 'regression');
CREATE USER MAPPING FOR CURRENT_USER
SERVER foreign_server
OPTIONS (user 'postgres');
CREATE FOREIGN TABLE foreign_table (
id integer NOT NULL,
data text,
a bigserial
)
SERVER foreign_server
OPTIONS (schema_name 'foreign_tables_schema_mx', table_name 'foreign_table_test');
select citus_add_local_table_to_metadata('foreign_table');
citus_add_local_table_to_metadata
---------------------------------------------------------------------
(1 row)