Adds public host to only hyperscale tests

pull/3546/head
Halil Ozan Akgul 2020-04-08 10:59:56 +03:00
parent d574ac33a8
commit 56e814a333
19 changed files with 114 additions and 114 deletions

View File

@ -9,19 +9,19 @@ SELECT run_command_on_workers($$CREATE SCHEMA type_conflict;$$);
-- create a type on a worker that should not cause data loss once overwritten with a type
-- from the coordinator
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SET citus.enable_ddl_propagation TO off;
SET search_path TO type_conflict;
CREATE TYPE my_precious_type AS (secret text, should bool);
CREATE TABLE local_table (a int, b my_precious_type);
INSERT INTO local_table VALUES (42, ('always bring a towel', true)::my_precious_type);
\c - - - :master_port
\c - - :master_host :master_port
SET search_path TO type_conflict;
-- overwrite the type on the worker from the coordinator. The type should be over written
-- but the data should not have been destroyed
CREATE TYPE my_precious_type AS (scatterd_secret text);
-- verify the data is retained
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SET search_path TO type_conflict;
-- show fields for table
SELECT pg_class.relname,
@ -45,7 +45,7 @@ SELECT * FROM local_table;
42 | ("always bring a towel",t)
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
SET search_path TO type_conflict;
-- make sure worker_create_or_replace correctly generates new names while types are existing
SELECT worker_create_or_replace_object('CREATE TYPE type_conflict.multi_conflicting_type AS (a int, b int);');

View File

@ -462,13 +462,13 @@ SELECT "Constraint", "Definition" FROM table_checks WHERE relid='products'::regc
---------------------------------------------------------------------
(0 rows)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.products_1450202'::regclass;
Constraint | Definition
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Tests to check the effect of rollback
BEGIN;
-- Add constraints (which will be rollbacked)
@ -482,13 +482,13 @@ SELECT "Constraint", "Definition" FROM table_checks WHERE relid='products'::regc
---------------------------------------------------------------------
(0 rows)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.products_1450202'::regclass;
Constraint | Definition
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE products;
SET citus.shard_count to 2;
-- Test if the ALTER TABLE %s ADD %s PRIMARY KEY %s works

View File

@ -334,7 +334,7 @@ SELECT create_distributed_table('check_example', 'partition_col', 'hash');
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Definition" FROM index_attrs WHERE
relid = 'check_example_partition_col_key_365056'::regclass;
Column | Type | Definition
@ -349,7 +349,7 @@ SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.check_ex
check_example_other_other_col_check | CHECK (abs(other_other_col) >= 100)
(2 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Index-based constraints are created with shard-extended names, but others
-- (e.g. expression-based table CHECK constraints) do _not_ have shardids in
-- their object names, _at least originally as designed_. At some point, we

View File

@ -224,13 +224,13 @@ DROP TABLE repmodel_test;
RESET citus.replication_model;
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 360025;
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relname FROM pg_class WHERE relname LIKE 'data_load_test%';
relname
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- creating an index after loading data works
BEGIN;
CREATE TABLE data_load_test (col1 int, col2 text, col3 serial);
@ -333,7 +333,7 @@ SELECT * FROM master_get_table_ddl_events('unlogged_table');
ALTER TABLE public.unlogged_table OWNER TO postgres
(2 rows)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relpersistence FROM pg_class WHERE relname LIKE 'unlogged_table_%';
relpersistence
---------------------------------------------------------------------
@ -343,7 +343,7 @@ SELECT relpersistence FROM pg_class WHERE relname LIKE 'unlogged_table_%';
u
(4 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Test rollback of create table
BEGIN;
CREATE TABLE rollback_table(id int, name varchar(20));
@ -355,13 +355,13 @@ SELECT create_distributed_table('rollback_table','id');
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
Column | Type | Modifiers
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Insert 3 rows to make sure that copy after shard creation touches the same
-- worker node twice.
BEGIN;
@ -378,13 +378,13 @@ NOTICE: Copying data from local table...
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
Column | Type | Modifiers
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
BEGIN;
CREATE TABLE rollback_table(id int, name varchar(20));
SELECT create_distributed_table('rollback_table','id');
@ -415,13 +415,13 @@ SELECT create_distributed_table('rollback_table','id');
\copy rollback_table from stdin delimiter ','
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
Column | Type | Modifiers
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
BEGIN;
CREATE TABLE tt1(id int);
SELECT create_distributed_table('tt1','id');
@ -441,7 +441,7 @@ INSERT INTO tt1 VALUES(1);
INSERT INTO tt2 SELECT * FROM tt1 WHERE id = 1;
COMMIT;
-- Table should exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt1_360069'::regclass;
Column | Type | Modifiers
---------------------------------------------------------------------
@ -454,7 +454,7 @@ SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt2_3
id | integer |
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE tt1;
DROP TABLE tt2;
-- It is known that creating a table with master_create_empty_shard is not
@ -475,22 +475,22 @@ SELECT master_create_empty_shard('append_tt1');
ROLLBACK;
-- Table exists on the worker node.
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.append_tt1_360077'::regclass;
Column | Type | Modifiers
---------------------------------------------------------------------
id | integer |
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid from pg_class WHERE relname LIKE 'public.tt1%');
Column | Type | Modifiers
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Queries executing with router executor is allowed in the same transaction
-- with create_distributed_table
BEGIN;
@ -512,14 +512,14 @@ SELECT * FROM tt1 WHERE id = 1;
COMMIT;
-- Placements should be created on the worker
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt1_360078'::regclass;
Column | Type | Modifiers
---------------------------------------------------------------------
id | integer |
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE tt1;
BEGIN;
CREATE TABLE tt1(id int);
@ -532,13 +532,13 @@ SELECT create_distributed_table('tt1','id');
DROP TABLE tt1;
COMMIT;
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid from pg_class WHERE relname LIKE 'tt1%');
Column | Type | Modifiers
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Tests with create_distributed_table & DDL & DML commands
-- Test should pass since GetPlacementListConnection can provide connections
-- in this order of execution

View File

@ -89,7 +89,7 @@ BEGIN;
52 | 52 | Wed Dec 31 16:00:00 2014 PST | t
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
SELECT initiator_node_identifier, transaction_number, transaction_stamp, (process_id = pg_backend_pid()) FROM get_current_transaction_id();
initiator_node_identifier | transaction_number | transaction_stamp | ?column?
---------------------------------------------------------------------

View File

@ -145,7 +145,7 @@ NOTICE: foreign-data wrapper "fake_fdw" does not have an extension defined
ALTER FOREIGN TABLE foreign_table rename to renamed_foreign_table;
ALTER FOREIGN TABLE renamed_foreign_table rename full_name to rename_name;
ALTER FOREIGN TABLE renamed_foreign_table alter rename_name type char(8);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
select table_name, column_name, data_type
from information_schema.columns
where table_schema='public' and table_name like 'renamed_foreign_table_%' and column_name <> 'id'
@ -158,7 +158,7 @@ order by table_name;
renamed_foreign_table_610003 | rename_name | character
(4 rows)
\c - - - :master_port
\c - - :master_host :master_port
SELECT master_get_table_ddl_events('renamed_foreign_table');
NOTICE: foreign-data wrapper "fake_fdw" does not have an extension defined
master_get_table_ddl_events
@ -175,7 +175,7 @@ ERROR: local_view is not a regular, foreign or partitioned table
-- clean up
DROP VIEW IF EXISTS local_view;
DROP FOREIGN TABLE IF EXISTS renamed_foreign_table;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
select table_name, column_name, data_type
from information_schema.columns
where table_schema='public' and table_name like 'renamed_foreign_table_%' and column_name <> 'id'
@ -184,7 +184,7 @@ order by table_name;
---------------------------------------------------------------------
(0 rows)
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE IF EXISTS simple_table, not_null_table, column_constraint_table,
table_constraint_table, default_value_table, pkey_table,
unique_table, clustered_table, fiddly_table;

View File

@ -20,7 +20,7 @@ SELECT master_create_worker_shards('too_long_12345678901234567890123456789012345
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt too_long_*
List of relations
Schema | Name | Type | Owner
@ -29,7 +29,7 @@ SELECT master_create_worker_shards('too_long_12345678901234567890123456789012345
public | too_long_12345678901234567890123456789012345678_e0119164_225001 | table | postgres
(2 rows)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
-- Verify that the UDF works and rejects bad arguments.
@ -80,7 +80,7 @@ ALTER TABLE name_lengths ADD EXCLUDE (int_col_1234567890123456789012345678901234
ERROR: cannot create constraint without a name on a distributed table
ALTER TABLE name_lengths ADD CHECK (date_col_12345678901234567890123456789012345678901234567890 > '2014-01-01'::date);
ERROR: cannot create constraint without a name on a distributed table
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='public.name_lengths_225002'::regclass ORDER BY 1 DESC, 2 DESC;
Column | Type | Modifiers
---------------------------------------------------------------------
@ -91,7 +91,7 @@ SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='public.name_le
col1 | integer | not null
(5 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Placeholders for unsupported add constraints with EXPLICIT names that are too long
ALTER TABLE name_lengths ADD CONSTRAINT nl_unique_12345678901234567890123456789012345678901234567890 UNIQUE (float_col_12345678901234567890123456789012345678901234567890);
ERROR: cannot create constraint on "name_lengths"
@ -100,14 +100,14 @@ ALTER TABLE name_lengths ADD CONSTRAINT nl_exclude_12345678901234567890123456789
ERROR: cannot create constraint on "name_lengths"
DETAIL: Distributed relations cannot have UNIQUE, EXCLUDE, or PRIMARY KEY constraints that do not include the partition column (with an equality operator if EXCLUDE).
ALTER TABLE name_lengths ADD CONSTRAINT nl_checky_12345678901234567890123456789012345678901234567890 CHECK (date_col_12345678901234567890123456789012345678901234567890 >= '2014-01-01'::date);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.name_lengths_225002'::regclass ORDER BY 1 DESC, 2 DESC;
Constraint | Definition
---------------------------------------------------------------------
nl_checky_1234567890123456789012345678901234567_b16df46d_225002 | CHECK (date_col_12345678901234567890123456789012345678901234567890 >= '01-01-2014'::date)
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
-- Placeholders for RENAME operations
\set VERBOSITY TERSE
ALTER TABLE name_lengths RENAME TO name_len_12345678901234567890123456789012345678901234567890;
@ -117,7 +117,7 @@ ERROR: renaming constraints belonging to distributed tables is currently unsupp
\set VERBOSITY DEFAULT
-- Verify that CREATE INDEX on already distributed table has proper shard names.
CREATE INDEX tmp_idx_12345678901234567890123456789012345678901234567890 ON name_lengths(col2);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
relname LIKE 'tmp_idx_%' ORDER BY 1 DESC, 2 DESC, 3 DESC, 4 DESC;
relname | Column | Type | Definition
@ -126,12 +126,12 @@ SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
tmp_idx_123456789012345678901234567890123456789_5e470afa_225002 | col2 | integer | col2
(2 rows)
\c - - - :master_port
\c - - :master_host :master_port
-- Verify that a new index name > 63 characters is auto-truncated
-- by the parser/rewriter before further processing, just as in Postgres.
CREATE INDEX tmp_idx_123456789012345678901234567890123456789012345678901234567890 ON name_lengths(col2);
NOTICE: identifier "tmp_idx_123456789012345678901234567890123456789012345678901234567890" will be truncated to "tmp_idx_1234567890123456789012345678901234567890123456789012345"
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
relname LIKE 'tmp_idx_%' ORDER BY 1 DESC, 2 DESC, 3 DESC, 4 DESC;
relname | Column | Type | Definition
@ -142,7 +142,7 @@ SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
tmp_idx_123456789012345678901234567890123456789_599636aa_225002 | col2 | integer | col2
(4 rows)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
-- Verify that distributed tables with too-long names
@ -190,7 +190,7 @@ SELECT master_create_worker_shards('sneaky_name_lengths', '2', '2');
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\di public.sneaky*225006
List of relations
Schema | Name | Type | Owner | Table
@ -204,7 +204,7 @@ SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.sneaky_n
checky_12345678901234567890123456789012345678901234567890 | CHECK (int_col_123456789012345678901234567890123456789012345678901234 > 100)
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
DROP TABLE sneaky_name_lengths CASCADE;
@ -221,7 +221,7 @@ SELECT create_distributed_table('sneaky_name_lengths', 'col1', 'hash');
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\di unique*225008
List of relations
Schema | Name | Type | Owner | Table
@ -229,7 +229,7 @@ SELECT create_distributed_table('sneaky_name_lengths', 'col1', 'hash');
public | unique_1234567890123456789012345678901234567890_a5986f27_225008 | index | postgres | sneaky_name_lengths_225008
(1 row)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
DROP TABLE sneaky_name_lengths CASCADE;
@ -244,7 +244,7 @@ SELECT create_distributed_table('too_long_12345678901234567890123456789012345678
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt *225000000000*
List of relations
Schema | Name | Type | Owner
@ -253,7 +253,7 @@ SELECT create_distributed_table('too_long_12345678901234567890123456789012345678
public | too_long_1234567890123456789012345678901_e0119164_2250000000001 | table | postgres
(2 rows)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
DROP TABLE too_long_12345678901234567890123456789012345678901234567890 CASCADE;
@ -276,7 +276,7 @@ WHERE logicalrelid = U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!0
"elephant_слонслонслонсло_c8b737c2_2250000000002"
(1 row)
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt public.elephant_*
List of relations
Schema | Name | Type | Owner
@ -293,7 +293,7 @@ WHERE logicalrelid = U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!0
public | elephant_слонслонслонсло_14d34928_2250000000003 | index | postgres | elephant_слонслонслонсло_c8b737c2_2250000000003
(2 rows)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
-- Verify that shard_name UDF supports schemas

View File

@ -50,7 +50,7 @@ CREATE TABLE repartition_udt_other (
-- Connect directly to a worker, create and drop the type, then
-- proceed with type creation as above; thus the OIDs will be different.
-- so that the OID is off.
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
-- START type creation
-- ... as well as a function to use as its comparator...
CREATE FUNCTION equal_test_udt_function(test_udt, test_udt) RETURNS boolean
@ -85,7 +85,7 @@ DEFAULT FOR TYPE test_udt USING HASH AS
OPERATOR 1 = (test_udt, test_udt),
FUNCTION 1 test_udt_hash(test_udt);
-- END type creation
\c - - - :worker_2_port
\c - - :public_worker_2_host :worker_2_port
-- START type creation
-- ... as well as a function to use as its comparator...
CREATE FUNCTION equal_test_udt_function(test_udt, test_udt) RETURNS boolean
@ -121,7 +121,7 @@ OPERATOR 1 = (test_udt, test_udt),
FUNCTION 1 test_udt_hash(test_udt);
-- END type creation
-- Connect to master
\c - - - :master_port
\c - - :master_host :master_port
-- Distribute and populate the two tables.
SET citus.shard_count TO 3;
SET citus.shard_replication_factor TO 1;

View File

@ -3,7 +3,7 @@
--
SET citus.next_shard_id TO 830000;
-- Create UDF in master and workers
\c - - - :master_port
\c - - :master_host :master_port
DROP FUNCTION IF EXISTS median(double precision[]);
NOTICE: function median(pg_catalog.float8[]) does not exist, skipping
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -13,7 +13,7 @@ LANGUAGE sql IMMUTABLE AS $_$
ORDER BY 1 LIMIT 2 - MOD(array_upper($1, 1), 2)
OFFSET CEIL(array_upper($1, 1) / 2.0) - 1) sub;
$_$;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
DROP FUNCTION IF EXISTS median(double precision[]);
NOTICE: function median(pg_catalog.float8[]) does not exist, skipping
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -23,7 +23,7 @@ LANGUAGE sql IMMUTABLE AS $_$
ORDER BY 1 LIMIT 2 - MOD(array_upper($1, 1), 2)
OFFSET CEIL(array_upper($1, 1) / 2.0) - 1) sub;
$_$;
\c - - - :worker_2_port
\c - - :public_worker_2_host :worker_2_port
DROP FUNCTION IF EXISTS median(double precision[]);
NOTICE: function median(pg_catalog.float8[]) does not exist, skipping
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -34,7 +34,7 @@ LANGUAGE sql IMMUTABLE AS $_$
OFFSET CEIL(array_upper($1, 1) / 2.0) - 1) sub;
$_$;
-- Run query on master
\c - - - :master_port
\c - - :master_host :master_port
SET citus.task_executor_type TO 'task-tracker';
SELECT * FROM (SELECT median(ARRAY[1,2,sum(l_suppkey)]) as median, count(*)
FROM lineitem GROUP BY l_partkey) AS a

View File

@ -198,7 +198,7 @@ SELECT master_create_worker_shards('second_dustbunnies', 1, 2);
(1 row)
-- run VACUUM and ANALYZE against the table on the master
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
VACUUM dustbunnies;
NOTICE: issuing VACUUM public.dustbunnies_990002
@ -229,13 +229,13 @@ NOTICE: issuing VACUUM (ANALYZE) public.dustbunnies_990002
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing VACUUM (ANALYZE) public.dustbunnies_990002
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
-- disable auto-VACUUM for next test
ALTER TABLE dustbunnies_990002 SET (autovacuum_enabled = false);
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid='dustbunnies_990002'::regclass
\gset
-- send a VACUUM FREEZE after adding a new row
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
INSERT INTO dustbunnies VALUES (5, 'peter');
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
@ -256,7 +256,7 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing VACUUM (FREEZE) public.dustbunnies_990002
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
-- verify that relfrozenxid increased
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid='dustbunnies_990002'::regclass;
frozen_performed
@ -275,7 +275,7 @@ WHERE tablename = 'dustbunnies_990002' ORDER BY attname;
(3 rows)
-- add NULL values, then perform column-specific ANALYZE
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
INSERT INTO dustbunnies VALUES (6, NULL, NULL);
NOTICE: issuing BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED;SELECT assign_distributed_transaction_id(xx, xx, 'xxxxxxx');
@ -304,7 +304,7 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing COMMIT
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
-- verify that name's NULL ratio is updated but age's is not
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT attname, null_frac FROM pg_stats
WHERE tablename = 'dustbunnies_990002' ORDER BY attname;
attname | null_frac
@ -314,7 +314,7 @@ WHERE tablename = 'dustbunnies_990002' ORDER BY attname;
name | 0.166667
(3 rows)
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
-- verify warning for unqualified VACUUM
VACUUM;

View File

@ -5,13 +5,13 @@ SELECT run_command_on_workers($$CREATE SCHEMA type_conflict;$$);
-- create a type on a worker that should not cause data loss once overwritten with a type
-- from the coordinator
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SET citus.enable_ddl_propagation TO off;
SET search_path TO type_conflict;
CREATE TYPE my_precious_type AS (secret text, should bool);
CREATE TABLE local_table (a int, b my_precious_type);
INSERT INTO local_table VALUES (42, ('always bring a towel', true)::my_precious_type);
\c - - - :master_port
\c - - :master_host :master_port
SET search_path TO type_conflict;
-- overwrite the type on the worker from the coordinator. The type should be over written
@ -19,7 +19,7 @@ SET search_path TO type_conflict;
CREATE TYPE my_precious_type AS (scatterd_secret text);
-- verify the data is retained
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SET search_path TO type_conflict;
-- show fields for table
SELECT pg_class.relname,
@ -34,7 +34,7 @@ ORDER BY attnum;
SELECT * FROM local_table;
\c - - - :master_port
\c - - :master_host :master_port
SET search_path TO type_conflict;
-- make sure worker_create_or_replace correctly generates new names while types are existing

View File

@ -406,11 +406,11 @@ ROLLBACK;
-- There should be no constraint on master and worker(s)
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='products'::regclass;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.products_1450202'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
-- Tests to check the effect of rollback
BEGIN;
@ -423,11 +423,11 @@ ROLLBACK;
-- There should be no constraint on master and worker(s)
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='products'::regclass;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.products_1450202'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE products;

View File

@ -224,11 +224,11 @@ CREATE TABLE check_example
other_other_col integer CHECK (abs(other_other_col) >= 100)
);
SELECT create_distributed_table('check_example', 'partition_col', 'hash');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Definition" FROM index_attrs WHERE
relid = 'check_example_partition_col_key_365056'::regclass;
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.check_example_365056'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
-- Index-based constraints are created with shard-extended names, but others
-- (e.g. expression-based table CHECK constraints) do _not_ have shardids in

View File

@ -58,7 +58,7 @@ BEGIN;
SELECT initiator_node_identifier, transaction_number, transaction_stamp, (process_id = pg_backend_pid()) FROM get_current_transaction_id();
\c - - - :master_port
\c - - :master_host :master_port
SELECT initiator_node_identifier, transaction_number, transaction_stamp, (process_id = pg_backend_pid()) FROM get_current_transaction_id();

View File

@ -105,12 +105,12 @@ SELECT create_distributed_table('foreign_table', 'id');
ALTER FOREIGN TABLE foreign_table rename to renamed_foreign_table;
ALTER FOREIGN TABLE renamed_foreign_table rename full_name to rename_name;
ALTER FOREIGN TABLE renamed_foreign_table alter rename_name type char(8);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
select table_name, column_name, data_type
from information_schema.columns
where table_schema='public' and table_name like 'renamed_foreign_table_%' and column_name <> 'id'
order by table_name;
\c - - - :master_port
\c - - :master_host :master_port
SELECT master_get_table_ddl_events('renamed_foreign_table');
@ -122,12 +122,12 @@ SELECT master_get_table_ddl_events('local_view');
-- clean up
DROP VIEW IF EXISTS local_view;
DROP FOREIGN TABLE IF EXISTS renamed_foreign_table;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
select table_name, column_name, data_type
from information_schema.columns
where table_schema='public' and table_name like 'renamed_foreign_table_%' and column_name <> 'id'
order by table_name;
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE IF EXISTS simple_table, not_null_table, column_constraint_table,
table_constraint_table, default_value_table, pkey_table,
unique_table, clustered_table, fiddly_table;

View File

@ -14,9 +14,9 @@ CREATE TABLE too_long_12345678901234567890123456789012345678901234567890 (
SELECT master_create_distributed_table('too_long_12345678901234567890123456789012345678901234567890', 'col1', 'hash');
SELECT master_create_worker_shards('too_long_12345678901234567890123456789012345678901234567890', '2', '2');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt too_long_*
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
@ -52,18 +52,18 @@ ALTER TABLE name_lengths ADD UNIQUE (float_col_123456789012345678901234567890123
ALTER TABLE name_lengths ADD EXCLUDE (int_col_12345678901234567890123456789012345678901234567890 WITH =);
ALTER TABLE name_lengths ADD CHECK (date_col_12345678901234567890123456789012345678901234567890 > '2014-01-01'::date);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='public.name_lengths_225002'::regclass ORDER BY 1 DESC, 2 DESC;
\c - - - :master_port
\c - - :master_host :master_port
-- Placeholders for unsupported add constraints with EXPLICIT names that are too long
ALTER TABLE name_lengths ADD CONSTRAINT nl_unique_12345678901234567890123456789012345678901234567890 UNIQUE (float_col_12345678901234567890123456789012345678901234567890);
ALTER TABLE name_lengths ADD CONSTRAINT nl_exclude_12345678901234567890123456789012345678901234567890 EXCLUDE (int_col_12345678901234567890123456789012345678901234567890 WITH =);
ALTER TABLE name_lengths ADD CONSTRAINT nl_checky_12345678901234567890123456789012345678901234567890 CHECK (date_col_12345678901234567890123456789012345678901234567890 >= '2014-01-01'::date);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.name_lengths_225002'::regclass ORDER BY 1 DESC, 2 DESC;
\c - - - :master_port
\c - - :master_host :master_port
-- Placeholders for RENAME operations
\set VERBOSITY TERSE
@ -76,19 +76,19 @@ ALTER TABLE name_lengths RENAME CONSTRAINT unique_123456789012345678901234567890
CREATE INDEX tmp_idx_12345678901234567890123456789012345678901234567890 ON name_lengths(col2);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
relname LIKE 'tmp_idx_%' ORDER BY 1 DESC, 2 DESC, 3 DESC, 4 DESC;
\c - - - :master_port
\c - - :master_host :master_port
-- Verify that a new index name > 63 characters is auto-truncated
-- by the parser/rewriter before further processing, just as in Postgres.
CREATE INDEX tmp_idx_123456789012345678901234567890123456789012345678901234567890 ON name_lengths(col2);
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "relname", "Column", "Type", "Definition" FROM index_attrs WHERE
relname LIKE 'tmp_idx_%' ORDER BY 1 DESC, 2 DESC, 3 DESC, 4 DESC;
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
@ -116,10 +116,10 @@ SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.sneaky_n
SELECT master_create_distributed_table('sneaky_name_lengths', 'int_col_123456789012345678901234567890123456789012345678901234', 'hash');
SELECT master_create_worker_shards('sneaky_name_lengths', '2', '2');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\di public.sneaky*225006
SELECT "Constraint", "Definition" FROM table_checks WHERE relid='public.sneaky_name_lengths_225006'::regclass ORDER BY 1 DESC, 2 DESC;
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
@ -135,9 +135,9 @@ CREATE TABLE sneaky_name_lengths (
);
SELECT create_distributed_table('sneaky_name_lengths', 'col1', 'hash');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\di unique*225008
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
@ -151,9 +151,9 @@ CREATE TABLE too_long_12345678901234567890123456789012345678901234567890 (
col2 integer not null);
SELECT create_distributed_table('too_long_12345678901234567890123456789012345678901234567890', 'col1', 'hash');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt *225000000000*
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;
@ -171,10 +171,10 @@ SELECT shard_name(U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B
FROM pg_dist_shard
WHERE logicalrelid = U&'elephant_!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D!0441!043B!043E!043D' UESCAPE '!'::regclass;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
\dt public.elephant_*
\di public.elephant_*
\c - - - :master_port
\c - - :master_host :master_port
SET citus.shard_count TO 2;
SET citus.shard_replication_factor TO 2;

View File

@ -65,7 +65,7 @@ CREATE TABLE repartition_udt_other (
-- proceed with type creation as above; thus the OIDs will be different.
-- so that the OID is off.
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
-- START type creation
-- ... as well as a function to use as its comparator...
@ -109,7 +109,7 @@ FUNCTION 1 test_udt_hash(test_udt);
-- END type creation
\c - - - :worker_2_port
\c - - :public_worker_2_host :worker_2_port
-- START type creation
-- ... as well as a function to use as its comparator...
@ -155,7 +155,7 @@ FUNCTION 1 test_udt_hash(test_udt);
-- Connect to master
\c - - - :master_port
\c - - :master_host :master_port
-- Distribute and populate the two tables.
SET citus.shard_count TO 3;

View File

@ -7,7 +7,7 @@ SET citus.next_shard_id TO 830000;
-- Create UDF in master and workers
\c - - - :master_port
\c - - :master_host :master_port
DROP FUNCTION IF EXISTS median(double precision[]);
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -18,7 +18,7 @@ LANGUAGE sql IMMUTABLE AS $_$
OFFSET CEIL(array_upper($1, 1) / 2.0) - 1) sub;
$_$;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
DROP FUNCTION IF EXISTS median(double precision[]);
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -29,7 +29,7 @@ LANGUAGE sql IMMUTABLE AS $_$
OFFSET CEIL(array_upper($1, 1) / 2.0) - 1) sub;
$_$;
\c - - - :worker_2_port
\c - - :public_worker_2_host :worker_2_port
DROP FUNCTION IF EXISTS median(double precision[]);
CREATE FUNCTION median(double precision[]) RETURNS double precision
@ -41,7 +41,7 @@ LANGUAGE sql IMMUTABLE AS $_$
$_$;
-- Run query on master
\c - - - :master_port
\c - - :master_host :master_port
SET citus.task_executor_type TO 'task-tracker';

View File

@ -131,7 +131,7 @@ SELECT master_create_distributed_table('second_dustbunnies', 'id', 'hash');
SELECT master_create_worker_shards('second_dustbunnies', 1, 2);
-- run VACUUM and ANALYZE against the table on the master
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
VACUUM dustbunnies;
@ -143,21 +143,21 @@ ANALYZE dustbunnies;
VACUUM (FULL) dustbunnies;
VACUUM ANALYZE dustbunnies;
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
-- disable auto-VACUUM for next test
ALTER TABLE dustbunnies_990002 SET (autovacuum_enabled = false);
SELECT relfrozenxid AS frozenxid FROM pg_class WHERE oid='dustbunnies_990002'::regclass
\gset
-- send a VACUUM FREEZE after adding a new row
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
INSERT INTO dustbunnies VALUES (5, 'peter');
VACUUM (FREEZE) dustbunnies;
-- verify that relfrozenxid increased
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relfrozenxid::text::integer > :frozenxid AS frozen_performed FROM pg_class
WHERE oid='dustbunnies_990002'::regclass;
@ -166,18 +166,18 @@ SELECT attname, null_frac FROM pg_stats
WHERE tablename = 'dustbunnies_990002' ORDER BY attname;
-- add NULL values, then perform column-specific ANALYZE
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
INSERT INTO dustbunnies VALUES (6, NULL, NULL);
ANALYZE dustbunnies (name);
-- verify that name's NULL ratio is updated but age's is not
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT attname, null_frac FROM pg_stats
WHERE tablename = 'dustbunnies_990002' ORDER BY attname;
\c - - - :master_port
\c - - :master_host :master_port
SET citus.log_remote_commands TO ON;
-- verify warning for unqualified VACUUM