SET client_min_messages TO WARNING;
CREATE EXTENSION IF NOT EXISTS citus_columnar;
RESET client_min_messages;
CREATE SCHEMA "citus_split_non_blocking_schema_columnar_partitioned";
SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
SET citus.next_shard_id TO 8970000;
SET citus.next_placement_id TO 8770000;
SET citus.shard_count TO 1;
SET citus.shard_replication_factor TO 1;
-- remove coordinator if it is added to pg_dist_node
SELECT COUNT(master_remove_node(nodename, nodeport)) >= 0
FROM pg_dist_node WHERE nodename='localhost' AND nodeport=:master_port;
 ?column?
---------------------------------------------------------------------
 t
(1 row)

-- Disable Deferred drop auto cleanup to avoid flaky tests.
ALTER SYSTEM SET citus.defer_shard_delete_interval TO -1;
SELECT pg_reload_conf();
 pg_reload_conf
---------------------------------------------------------------------
 t
(1 row)

-- BEGIN: Create table to split, along with other co-located tables. Add indexes, statistics etc.
    CREATE TABLE sensors(
        measureid         integer,
        eventdatetime     date,
        measure_data      jsonb,
        PRIMARY KEY (measureid, eventdatetime, measure_data))
    PARTITION BY RANGE(eventdatetime);
    -- Table access method is specified on child tables
    CREATE TABLE sensorscolumnar(
        measureid         integer,
        eventdatetime     date,
        measure_data      jsonb,
        PRIMARY KEY (measureid, eventdatetime, measure_data))
    PARTITION BY RANGE(eventdatetime);
    -- Create Partitions of table 'sensors'.
    CREATE TABLE sensors_old PARTITION OF sensors FOR VALUES FROM ('2000-01-01') TO ('2020-01-01');
    CREATE TABLE sensors_2020_01_01 PARTITION OF sensors FOR VALUES FROM ('2020-01-01') TO ('2020-02-01');
    CREATE TABLE sensors_news PARTITION OF sensors FOR VALUES FROM ('2020-05-01') TO ('2025-01-01');
    CREATE TABLE sensorscolumnar_old PARTITION OF sensorscolumnar FOR VALUES FROM ('2000-01-01') TO ('2020-01-01')  USING COLUMNAR;
    CREATE TABLE sensorscolumnar_2020_01_01 PARTITION OF sensorscolumnar FOR VALUES FROM ('2020-01-01') TO ('2020-02-01')  USING COLUMNAR;
    CREATE TABLE sensorscolumnar_news PARTITION OF sensorscolumnar FOR VALUES FROM ('2020-05-01') TO ('2025-01-01') USING COLUMNAR;
    -- Create index on parent and child partitions.
    CREATE INDEX index_on_parent ON sensors(lower(measureid::text));
    CREATE INDEX index_on_child ON sensors_2020_01_01(lower(measure_data::text));
    CREATE INDEX index_on_parent_columnar ON sensorscolumnar(lower(measureid::text));
    CREATE INDEX index_on_child_columnar ON sensorscolumnar_2020_01_01(lower(measure_data::text));
    ALTER INDEX index_on_parent ALTER COLUMN 1 SET STATISTICS 1000;
    ALTER INDEX index_on_child ALTER COLUMN 1 SET STATISTICS 1000;
    ALTER INDEX index_on_parent_columnar ALTER COLUMN 1 SET STATISTICS 1000;
    ALTER INDEX index_on_child_columnar ALTER COLUMN 1 SET STATISTICS 1000;
    -- Create statistics on parent and child partitions.
    CREATE STATISTICS s1 (dependencies) ON measureid, eventdatetime FROM sensors;
    CREATE STATISTICS s2 (dependencies) ON measureid, eventdatetime FROM sensors_2020_01_01;
    CREATE STATISTICS s1_c (dependencies) ON measureid, eventdatetime FROM sensorscolumnar;
    CREATE STATISTICS s2_c (dependencies) ON measureid, eventdatetime FROM sensorscolumnar_2020_01_01;
    CLUSTER sensors_2020_01_01 USING index_on_child;
    SELECT create_distributed_table('sensors', 'measureid');
 create_distributed_table
---------------------------------------------------------------------

(1 row)

    SELECT create_distributed_table('sensorscolumnar', 'measureid');
 create_distributed_table
---------------------------------------------------------------------

(1 row)

    -- create colocated distributed tables
    CREATE TABLE colocated_dist_table (measureid integer PRIMARY KEY);
    SELECT create_distributed_table('colocated_dist_table', 'measureid');
 create_distributed_table
---------------------------------------------------------------------

(1 row)

    CLUSTER colocated_dist_table USING colocated_dist_table_pkey;
    CREATE TABLE colocated_partitioned_table(
        measureid         integer,
        eventdatetime     date,
        PRIMARY KEY (measureid, eventdatetime))
    PARTITION BY RANGE(eventdatetime);
    CREATE TABLE colocated_partitioned_table_2020_01_01 PARTITION OF colocated_partitioned_table FOR VALUES FROM ('2020-01-01') TO ('2020-02-01');
    SELECT create_distributed_table('colocated_partitioned_table', 'measureid');
 create_distributed_table
---------------------------------------------------------------------

(1 row)

    CLUSTER colocated_partitioned_table_2020_01_01 USING colocated_partitioned_table_2020_01_01_pkey;
    -- create reference tables
    CREATE TABLE reference_table (measureid integer PRIMARY KEY);
    SELECT create_reference_table('reference_table');
 create_reference_table
---------------------------------------------------------------------

(1 row)

    SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
    FROM pg_dist_shard AS shard
    INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
    INNER JOIN pg_dist_node       node     ON placement.groupid = node.groupid
    INNER JOIN pg_catalog.pg_class cls     ON shard.logicalrelid = cls.oid
    INNER JOIN pg_catalog.pg_namespace ns  ON cls.relnamespace = ns.oid
    WHERE node.noderole = 'primary' AND ns.nspname = 'citus_split_non_blocking_schema_columnar_partitioned'
    ORDER BY logicalrelid, shardminvalue::BIGINT, nodeport;
 shardid |              logicalrelid              | shardminvalue | shardmaxvalue | nodename  | nodeport
---------------------------------------------------------------------
 8970000 | sensors                                | -2147483648   | 2147483647    | localhost |    57637
 8970004 | sensorscolumnar                        | -2147483648   | 2147483647    | localhost |    57637
 8970001 | sensors_old                            | -2147483648   | 2147483647    | localhost |    57637
 8970002 | sensors_2020_01_01                     | -2147483648   | 2147483647    | localhost |    57637
 8970003 | sensors_news                           | -2147483648   | 2147483647    | localhost |    57637
 8970005 | sensorscolumnar_old                    | -2147483648   | 2147483647    | localhost |    57637
 8970006 | sensorscolumnar_2020_01_01             | -2147483648   | 2147483647    | localhost |    57637
 8970007 | sensorscolumnar_news                   | -2147483648   | 2147483647    | localhost |    57637
 8970008 | colocated_dist_table                   | -2147483648   | 2147483647    | localhost |    57637
 8970009 | colocated_partitioned_table            | -2147483648   | 2147483647    | localhost |    57637
 8970010 | colocated_partitioned_table_2020_01_01 | -2147483648   | 2147483647    | localhost |    57637
 8970011 | reference_table                        |               |               | localhost |    57637
 8970011 | reference_table                        |               |               | localhost |    57638
(13 rows)

-- END: Create table to split, along with other co-located tables. Add indexes, statistics etc.
-- BEGIN: Create constraints for tables.
    -- from parent to regular dist
    ALTER TABLE sensors ADD CONSTRAINT fkey_from_parent_to_dist FOREIGN KEY (measureid) REFERENCES colocated_dist_table(measureid);
    -- from parent to parent
    ALTER TABLE sensors ADD CONSTRAINT fkey_from_parent_to_parent FOREIGN KEY (measureid, eventdatetime) REFERENCES colocated_partitioned_table(measureid, eventdatetime);
    -- from parent to child
    ALTER TABLE sensors ADD CONSTRAINT fkey_from_parent_to_child FOREIGN KEY (measureid, eventdatetime) REFERENCES colocated_partitioned_table_2020_01_01(measureid, eventdatetime);
    ALTER TABLE sensors ADD CONSTRAINT fkey_from_parent_to_ref FOREIGN KEY (measureid) REFERENCES reference_table(measureid);
    -- from child to regular dist
    ALTER TABLE sensors_2020_01_01 ADD CONSTRAINT fkey_from_child_to_dist FOREIGN KEY (measureid) REFERENCES colocated_dist_table(measureid);
    -- from child to parent
    ALTER TABLE sensors_2020_01_01 ADD CONSTRAINT fkey_from_child_to_parent FOREIGN KEY (measureid,eventdatetime) REFERENCES colocated_partitioned_table(measureid,eventdatetime);
    -- from child to child
    ALTER TABLE sensors_2020_01_01 ADD CONSTRAINT fkey_from_child_to_child FOREIGN KEY (measureid,eventdatetime) REFERENCES colocated_partitioned_table_2020_01_01(measureid,eventdatetime);
    ALTER TABLE sensors_2020_01_01 ADD CONSTRAINT fkey_from_child_to_ref FOREIGN KEY (measureid) REFERENCES reference_table(measureid);
    -- No support for foreign keys, unique constraints, or exclusion constraints in columnar tables.
    -- Please see: https://github.com/citusdata/citus/tree/main/src/backend/columnar/README.md
-- END: Create constraints for tables.
-- BEGIN: Load data into tables
    INSERT INTO reference_table SELECT i FROM generate_series(0,1000)i;
    INSERT INTO colocated_dist_table SELECT i FROM generate_series(0,1000)i;
    INSERT INTO colocated_partitioned_table SELECT i, '2020-01-05' FROM generate_series(0,1000)i;
    INSERT INTO sensors SELECT i, '2020-01-05', '{}' FROM generate_series(0,1000)i;
    INSERT INTO sensorscolumnar SELECT i, '2020-01-05', '{}' FROM generate_series(0,1000)i;
-- END: Load data into tables
-- BEGIN: Show the current state on workers
\c - - - :worker_1_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
          relname           |             Constraint             |                                                         Definition
---------------------------------------------------------------------
 sensors_2020_01_01_8970002 | fkey_from_child_to_child_8970002   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8970010(eventdatetime, measureid)
 sensors_2020_01_01_8970002 | fkey_from_child_to_dist_8970002    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8970008(measureid)
 sensors_2020_01_01_8970002 | fkey_from_child_to_parent_8970002  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8970009(eventdatetime, measureid)
 sensors_2020_01_01_8970002 | fkey_from_child_to_ref_8970002     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8970002 | fkey_from_parent_to_child_8970000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8970010(eventdatetime, measureid)
 sensors_2020_01_01_8970002 | fkey_from_parent_to_dist_8970000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8970008(measureid)
 sensors_2020_01_01_8970002 | fkey_from_parent_to_parent_8970000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8970009(eventdatetime, measureid)
 sensors_2020_01_01_8970002 | fkey_from_parent_to_ref_8970000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8970000            | fkey_from_parent_to_child_8970000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8970010(eventdatetime, measureid)
 sensors_8970000            | fkey_from_parent_to_dist_8970000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8970008(measureid)
 sensors_8970000            | fkey_from_parent_to_parent_8970000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8970009(eventdatetime, measureid)
 sensors_8970000            | fkey_from_parent_to_ref_8970000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8970003       | fkey_from_parent_to_child_8970000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8970010(eventdatetime, measureid)
 sensors_news_8970003       | fkey_from_parent_to_dist_8970000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8970008(measureid)
 sensors_news_8970003       | fkey_from_parent_to_parent_8970000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8970009(eventdatetime, measureid)
 sensors_news_8970003       | fkey_from_parent_to_ref_8970000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8970001        | fkey_from_parent_to_child_8970000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8970010(eventdatetime, measureid)
 sensors_old_8970001        | fkey_from_parent_to_dist_8970000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8970008(measureid)
 sensors_old_8970001        | fkey_from_parent_to_parent_8970000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8970009(eventdatetime, measureid)
 sensors_old_8970001        | fkey_from_parent_to_ref_8970000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
(20 rows)

-- separating generated child FK constraints since PG18 changed their naming (3db61db4)
    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              2
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
                   tablename                    |                                                                                                       indexdef
---------------------------------------------------------------------
 colocated_dist_table_8970008                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8970008 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8970008 USING btree (measureid)
 colocated_partitioned_table_2020_01_01_8970010 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8970010 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8970010 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8970009            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8970009 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8970009 USING btree (measureid, eventdatetime)
 reference_table_8970011                        | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
 sensors_2020_01_01_8970002                     | CREATE INDEX index_on_child_8970002 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8970002 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8970002                     | CREATE INDEX sensors_2020_01_01_lower_idx_8970002 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8970002 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8970002                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8970002 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8970002 USING btree (measureid, eventdatetime, measure_data)
 sensors_8970000                                | CREATE INDEX index_on_parent_8970000 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8970000 USING btree (lower((measureid)::text))
 sensors_8970000                                | CREATE UNIQUE INDEX sensors_pkey_8970000 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8970000 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8970003                           | CREATE INDEX sensors_news_lower_idx_8970003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8970003 USING btree (lower((measureid)::text))
 sensors_news_8970003                           | CREATE UNIQUE INDEX sensors_news_pkey_8970003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8970003 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8970001                            | CREATE INDEX sensors_old_lower_idx_8970001 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8970001 USING btree (lower((measureid)::text))
 sensors_old_8970001                            | CREATE UNIQUE INDEX sensors_old_pkey_8970001 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8970001 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8970006             | CREATE INDEX index_on_child_columnar_8970006 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8970006 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8970006             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8970006 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8970006 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8970006             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8970006 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8970006 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8970004                        | CREATE INDEX index_on_parent_columnar_8970004 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8970004 USING btree (lower((measureid)::text))
 sensorscolumnar_8970004                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8970004 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8970004 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8970007                   | CREATE INDEX sensorscolumnar_news_lower_idx_8970007 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8970007 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8970007                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8970007 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8970007 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8970005                    | CREATE INDEX sensorscolumnar_old_lower_idx_8970005 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8970005 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8970005                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8970005 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8970005 USING btree (measureid, eventdatetime, measure_data)
(22 rows)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
   stxname
---------------------------------------------------------------------
 s1
 s1_8970000
 s1_c
 s1_c_8970004
 s2
 s2_8970002
 s2_c
 s2_c_8970006
(8 rows)

    \c - - - :worker_2_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
 relname | Constraint | Definition
---------------------------------------------------------------------
(0 rows)

    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              0
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
        tablename        |                                                                         indexdef
---------------------------------------------------------------------
 reference_table_8970011 | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
(1 row)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
 stxname
---------------------------------------------------------------------
 s1
 s1_c
 s2
 s2_c
(4 rows)

-- END: Show the current state on workers
-- BEGIN: Split a shard along its co-located shards
\c - - - :master_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.next_shard_id TO 8999000;
    SELECT nodeid AS worker_1_node FROM pg_dist_node WHERE nodeport=:worker_1_port \gset
    SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \gset
    SELECT pg_catalog.citus_split_shard_by_split_points(
        8970000,
        ARRAY['-2120000000'],
        ARRAY[:worker_1_node, :worker_2_node],
        'force_logical');
 citus_split_shard_by_split_points
---------------------------------------------------------------------

(1 row)

-- END: Split a shard along its co-located shards
-- BEGIN: Perform deferred cleanup.
SELECT public.wait_for_resource_cleanup();
 wait_for_resource_cleanup
---------------------------------------------------------------------

(1 row)

-- END: Perform deferred cleanup.
-- BEGIN: Validate Shard Info and Data
    SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
    FROM pg_dist_shard AS shard
    INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
    INNER JOIN pg_dist_node       node     ON placement.groupid = node.groupid
    INNER JOIN pg_catalog.pg_class cls     ON shard.logicalrelid = cls.oid
    INNER JOIN pg_catalog.pg_namespace ns  ON cls.relnamespace = ns.oid
    WHERE node.noderole = 'primary' AND ns.nspname = 'citus_split_non_blocking_schema_columnar_partitioned'
    ORDER BY logicalrelid, shardminvalue::BIGINT, nodeport;
 shardid |              logicalrelid              | shardminvalue | shardmaxvalue | nodename  | nodeport
---------------------------------------------------------------------
 8999000 | sensors                                | -2147483648   | -2120000000   | localhost |    57637
 8999001 | sensors                                | -2119999999   | 2147483647    | localhost |    57638
 8999008 | sensorscolumnar                        | -2147483648   | -2120000000   | localhost |    57637
 8999009 | sensorscolumnar                        | -2119999999   | 2147483647    | localhost |    57638
 8999002 | sensors_old                            | -2147483648   | -2120000000   | localhost |    57637
 8999003 | sensors_old                            | -2119999999   | 2147483647    | localhost |    57638
 8999004 | sensors_2020_01_01                     | -2147483648   | -2120000000   | localhost |    57637
 8999005 | sensors_2020_01_01                     | -2119999999   | 2147483647    | localhost |    57638
 8999006 | sensors_news                           | -2147483648   | -2120000000   | localhost |    57637
 8999007 | sensors_news                           | -2119999999   | 2147483647    | localhost |    57638
 8999010 | sensorscolumnar_old                    | -2147483648   | -2120000000   | localhost |    57637
 8999011 | sensorscolumnar_old                    | -2119999999   | 2147483647    | localhost |    57638
 8999012 | sensorscolumnar_2020_01_01             | -2147483648   | -2120000000   | localhost |    57637
 8999013 | sensorscolumnar_2020_01_01             | -2119999999   | 2147483647    | localhost |    57638
 8999014 | sensorscolumnar_news                   | -2147483648   | -2120000000   | localhost |    57637
 8999015 | sensorscolumnar_news                   | -2119999999   | 2147483647    | localhost |    57638
 8999016 | colocated_dist_table                   | -2147483648   | -2120000000   | localhost |    57637
 8999017 | colocated_dist_table                   | -2119999999   | 2147483647    | localhost |    57638
 8999018 | colocated_partitioned_table            | -2147483648   | -2120000000   | localhost |    57637
 8999019 | colocated_partitioned_table            | -2119999999   | 2147483647    | localhost |    57638
 8999020 | colocated_partitioned_table_2020_01_01 | -2147483648   | -2120000000   | localhost |    57637
 8999021 | colocated_partitioned_table_2020_01_01 | -2119999999   | 2147483647    | localhost |    57638
 8970011 | reference_table                        |               |               | localhost |    57637
 8970011 | reference_table                        |               |               | localhost |    57638
(24 rows)

    SELECT count(*) FROM reference_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM colocated_partitioned_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM colocated_dist_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM sensors;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM sensorscolumnar;
 count
---------------------------------------------------------------------
  1001
(1 row)

-- END: Validate Shard Info and Data
-- BEGIN: Show the updated state on workers
    \c - - - :worker_1_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
          relname           |             Constraint             |                                                         Definition
---------------------------------------------------------------------
 sensors_2020_01_01_8999004 | fkey_from_child_to_child_8999004   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999020(eventdatetime, measureid)
 sensors_2020_01_01_8999004 | fkey_from_child_to_dist_8999004    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999016(measureid)
 sensors_2020_01_01_8999004 | fkey_from_child_to_parent_8999004  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999018(eventdatetime, measureid)
 sensors_2020_01_01_8999004 | fkey_from_child_to_ref_8999004     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999004 | fkey_from_parent_to_child_8999000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999020(eventdatetime, measureid)
 sensors_2020_01_01_8999004 | fkey_from_parent_to_dist_8999000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999016(measureid)
 sensors_2020_01_01_8999004 | fkey_from_parent_to_parent_8999000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999018(eventdatetime, measureid)
 sensors_2020_01_01_8999004 | fkey_from_parent_to_ref_8999000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8999000            | fkey_from_parent_to_child_8999000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999020(eventdatetime, measureid)
 sensors_8999000            | fkey_from_parent_to_dist_8999000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999016(measureid)
 sensors_8999000            | fkey_from_parent_to_parent_8999000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999018(eventdatetime, measureid)
 sensors_8999000            | fkey_from_parent_to_ref_8999000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8999006       | fkey_from_parent_to_child_8999000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999020(eventdatetime, measureid)
 sensors_news_8999006       | fkey_from_parent_to_dist_8999000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999016(measureid)
 sensors_news_8999006       | fkey_from_parent_to_parent_8999000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999018(eventdatetime, measureid)
 sensors_news_8999006       | fkey_from_parent_to_ref_8999000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8999002        | fkey_from_parent_to_child_8999000  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999020(eventdatetime, measureid)
 sensors_old_8999002        | fkey_from_parent_to_dist_8999000   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999016(measureid)
 sensors_old_8999002        | fkey_from_parent_to_parent_8999000 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999018(eventdatetime, measureid)
 sensors_old_8999002        | fkey_from_parent_to_ref_8999000    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
(20 rows)

    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              2
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
                   tablename                    |                                                                                                       indexdef
---------------------------------------------------------------------
 colocated_dist_table_8999016                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8999016 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8999016 USING btree (measureid)
 colocated_partitioned_table_2020_01_01_8999020 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8999020 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8999020 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8999018            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8999018 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8999018 USING btree (measureid, eventdatetime)
 reference_table_8970011                        | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
 sensors_2020_01_01_8999004                     | CREATE INDEX index_on_child_8999004 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999004 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8999004                     | CREATE INDEX sensors_2020_01_01_lower_idx_8999004 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999004 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8999004                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8999004 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999004 USING btree (measureid, eventdatetime, measure_data)
 sensors_8999000                                | CREATE INDEX index_on_parent_8999000 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999000 USING btree (lower((measureid)::text))
 sensors_8999000                                | CREATE UNIQUE INDEX sensors_pkey_8999000 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999000 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8999006                           | CREATE INDEX sensors_news_lower_idx_8999006 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999006 USING btree (lower((measureid)::text))
 sensors_news_8999006                           | CREATE UNIQUE INDEX sensors_news_pkey_8999006 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999006 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8999002                            | CREATE INDEX sensors_old_lower_idx_8999002 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999002 USING btree (lower((measureid)::text))
 sensors_old_8999002                            | CREATE UNIQUE INDEX sensors_old_pkey_8999002 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999002 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8999012             | CREATE INDEX index_on_child_columnar_8999012 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999012 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8999012             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8999012 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999012 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8999012             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8999012 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999012 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8999008                        | CREATE INDEX index_on_parent_columnar_8999008 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999008 USING btree (lower((measureid)::text))
 sensorscolumnar_8999008                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8999008 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999008 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8999014                   | CREATE INDEX sensorscolumnar_news_lower_idx_8999014 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999014 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8999014                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8999014 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999014 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8999010                    | CREATE INDEX sensorscolumnar_old_lower_idx_8999010 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999010 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8999010                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8999010 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999010 USING btree (measureid, eventdatetime, measure_data)
(22 rows)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
   stxname
---------------------------------------------------------------------
 s1
 s1_8999000
 s1_c
 s1_c_8999008
 s2
 s2_8999004
 s2_c
 s2_c_8999012
(8 rows)

    \c - - - :worker_2_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
          relname           |             Constraint             |                                                         Definition
---------------------------------------------------------------------
 sensors_2020_01_01_8999005 | fkey_from_child_to_child_8999005   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_dist_8999005    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_parent_8999005  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_ref_8999005     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8999001            | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_8999001            | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_8999001            | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_8999001            | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8999007       | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_news_8999007       | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_news_8999007       | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_news_8999007       | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8999003        | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_old_8999003        | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_old_8999003        | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_old_8999003        | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
(20 rows)

    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              2
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
                   tablename                    |                                                                                                       indexdef
---------------------------------------------------------------------
 colocated_dist_table_8999017                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8999017 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8999017 USING btree (measureid)
 colocated_partitioned_table_2020_01_01_8999021 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8999021 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8999021 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8999019            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8999019 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8999019 USING btree (measureid, eventdatetime)
 reference_table_8970011                        | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
 sensors_2020_01_01_8999005                     | CREATE INDEX index_on_child_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8999005                     | CREATE INDEX sensors_2020_01_01_lower_idx_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8999005                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (measureid, eventdatetime, measure_data)
 sensors_8999001                                | CREATE INDEX index_on_parent_8999001 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999001 USING btree (lower((measureid)::text))
 sensors_8999001                                | CREATE UNIQUE INDEX sensors_pkey_8999001 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999001 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8999007                           | CREATE INDEX sensors_news_lower_idx_8999007 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999007 USING btree (lower((measureid)::text))
 sensors_news_8999007                           | CREATE UNIQUE INDEX sensors_news_pkey_8999007 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999007 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8999003                            | CREATE INDEX sensors_old_lower_idx_8999003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999003 USING btree (lower((measureid)::text))
 sensors_old_8999003                            | CREATE UNIQUE INDEX sensors_old_pkey_8999003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999003 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8999013             | CREATE INDEX index_on_child_columnar_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8999013             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8999013             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8999009                        | CREATE INDEX index_on_parent_columnar_8999009 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999009 USING btree (lower((measureid)::text))
 sensorscolumnar_8999009                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8999009 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999009 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8999015                   | CREATE INDEX sensorscolumnar_news_lower_idx_8999015 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999015 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8999015                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8999015 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999015 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8999011                    | CREATE INDEX sensorscolumnar_old_lower_idx_8999011 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999011 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8999011                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8999011 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999011 USING btree (measureid, eventdatetime, measure_data)
(22 rows)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
   stxname
---------------------------------------------------------------------
 s1
 s1_8999001
 s1_c
 s1_c_8999009
 s2
 s2_8999005
 s2_c
 s2_c_8999013
(8 rows)

-- END: Show the updated state on workers
-- BEGIN: Split a partition table directly
\c - - - :master_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.next_shard_id TO 8999100;
    SELECT nodeid AS worker_1_node FROM pg_dist_node WHERE nodeport=:worker_1_port \gset
    SELECT nodeid AS worker_2_node FROM pg_dist_node WHERE nodeport=:worker_2_port \gset
    SELECT pg_catalog.citus_split_shard_by_split_points(
        8999002, -- sensors_old
        ARRAY['-2127770000'],
        ARRAY[:worker_1_node, :worker_2_node],
        'force_logical');
 citus_split_shard_by_split_points
---------------------------------------------------------------------

(1 row)

-- END: Split a partition table directly
-- BEGIN: Perform deferred cleanup.
SELECT public.wait_for_resource_cleanup();
 wait_for_resource_cleanup
---------------------------------------------------------------------

(1 row)

-- END: Perform deferred cleanup.
-- BEGIN: Validate Shard Info and Data
    SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
    FROM pg_dist_shard AS shard
    INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
    INNER JOIN pg_dist_node       node     ON placement.groupid = node.groupid
    INNER JOIN pg_catalog.pg_class cls     ON shard.logicalrelid = cls.oid
    INNER JOIN pg_catalog.pg_namespace ns  ON cls.relnamespace = ns.oid
    WHERE node.noderole = 'primary' AND ns.nspname = 'citus_split_non_blocking_schema_columnar_partitioned'
    ORDER BY logicalrelid, shardminvalue::BIGINT, nodeport;
 shardid |              logicalrelid              | shardminvalue | shardmaxvalue | nodename  | nodeport
---------------------------------------------------------------------
 8999100 | sensors                                | -2147483648   | -2127770000   | localhost |    57637
 8999101 | sensors                                | -2127769999   | -2120000000   | localhost |    57638
 8999001 | sensors                                | -2119999999   | 2147483647    | localhost |    57638
 8999108 | sensorscolumnar                        | -2147483648   | -2127770000   | localhost |    57637
 8999109 | sensorscolumnar                        | -2127769999   | -2120000000   | localhost |    57638
 8999009 | sensorscolumnar                        | -2119999999   | 2147483647    | localhost |    57638
 8999102 | sensors_old                            | -2147483648   | -2127770000   | localhost |    57637
 8999103 | sensors_old                            | -2127769999   | -2120000000   | localhost |    57638
 8999003 | sensors_old                            | -2119999999   | 2147483647    | localhost |    57638
 8999104 | sensors_2020_01_01                     | -2147483648   | -2127770000   | localhost |    57637
 8999105 | sensors_2020_01_01                     | -2127769999   | -2120000000   | localhost |    57638
 8999005 | sensors_2020_01_01                     | -2119999999   | 2147483647    | localhost |    57638
 8999106 | sensors_news                           | -2147483648   | -2127770000   | localhost |    57637
 8999107 | sensors_news                           | -2127769999   | -2120000000   | localhost |    57638
 8999007 | sensors_news                           | -2119999999   | 2147483647    | localhost |    57638
 8999110 | sensorscolumnar_old                    | -2147483648   | -2127770000   | localhost |    57637
 8999111 | sensorscolumnar_old                    | -2127769999   | -2120000000   | localhost |    57638
 8999011 | sensorscolumnar_old                    | -2119999999   | 2147483647    | localhost |    57638
 8999112 | sensorscolumnar_2020_01_01             | -2147483648   | -2127770000   | localhost |    57637
 8999113 | sensorscolumnar_2020_01_01             | -2127769999   | -2120000000   | localhost |    57638
 8999013 | sensorscolumnar_2020_01_01             | -2119999999   | 2147483647    | localhost |    57638
 8999114 | sensorscolumnar_news                   | -2147483648   | -2127770000   | localhost |    57637
 8999115 | sensorscolumnar_news                   | -2127769999   | -2120000000   | localhost |    57638
 8999015 | sensorscolumnar_news                   | -2119999999   | 2147483647    | localhost |    57638
 8999116 | colocated_dist_table                   | -2147483648   | -2127770000   | localhost |    57637
 8999117 | colocated_dist_table                   | -2127769999   | -2120000000   | localhost |    57638
 8999017 | colocated_dist_table                   | -2119999999   | 2147483647    | localhost |    57638
 8999118 | colocated_partitioned_table            | -2147483648   | -2127770000   | localhost |    57637
 8999119 | colocated_partitioned_table            | -2127769999   | -2120000000   | localhost |    57638
 8999019 | colocated_partitioned_table            | -2119999999   | 2147483647    | localhost |    57638
 8999120 | colocated_partitioned_table_2020_01_01 | -2147483648   | -2127770000   | localhost |    57637
 8999121 | colocated_partitioned_table_2020_01_01 | -2127769999   | -2120000000   | localhost |    57638
 8999021 | colocated_partitioned_table_2020_01_01 | -2119999999   | 2147483647    | localhost |    57638
 8970011 | reference_table                        |               |               | localhost |    57637
 8970011 | reference_table                        |               |               | localhost |    57638
(35 rows)

    SELECT count(*) FROM reference_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM colocated_partitioned_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM colocated_dist_table;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM sensors;
 count
---------------------------------------------------------------------
  1001
(1 row)

    SELECT count(*) FROM sensorscolumnar;
 count
---------------------------------------------------------------------
  1001
(1 row)

-- END: Validate Shard Info and Data
-- BEGIN: Show the updated state on workers
    \c - - - :worker_1_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
          relname           |             Constraint             |                                                         Definition
---------------------------------------------------------------------
 sensors_2020_01_01_8999104 | fkey_from_child_to_child_8999104   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999120(eventdatetime, measureid)
 sensors_2020_01_01_8999104 | fkey_from_child_to_dist_8999104    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999116(measureid)
 sensors_2020_01_01_8999104 | fkey_from_child_to_parent_8999104  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999118(eventdatetime, measureid)
 sensors_2020_01_01_8999104 | fkey_from_child_to_ref_8999104     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999104 | fkey_from_parent_to_child_8999100  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999120(eventdatetime, measureid)
 sensors_2020_01_01_8999104 | fkey_from_parent_to_dist_8999100   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999116(measureid)
 sensors_2020_01_01_8999104 | fkey_from_parent_to_parent_8999100 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999118(eventdatetime, measureid)
 sensors_2020_01_01_8999104 | fkey_from_parent_to_ref_8999100    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8999100            | fkey_from_parent_to_child_8999100  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999120(eventdatetime, measureid)
 sensors_8999100            | fkey_from_parent_to_dist_8999100   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999116(measureid)
 sensors_8999100            | fkey_from_parent_to_parent_8999100 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999118(eventdatetime, measureid)
 sensors_8999100            | fkey_from_parent_to_ref_8999100    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8999106       | fkey_from_parent_to_child_8999100  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999120(eventdatetime, measureid)
 sensors_news_8999106       | fkey_from_parent_to_dist_8999100   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999116(measureid)
 sensors_news_8999106       | fkey_from_parent_to_parent_8999100 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999118(eventdatetime, measureid)
 sensors_news_8999106       | fkey_from_parent_to_ref_8999100    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8999102        | fkey_from_parent_to_child_8999100  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999120(eventdatetime, measureid)
 sensors_old_8999102        | fkey_from_parent_to_dist_8999100   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999116(measureid)
 sensors_old_8999102        | fkey_from_parent_to_parent_8999100 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999118(eventdatetime, measureid)
 sensors_old_8999102        | fkey_from_parent_to_ref_8999100    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
(20 rows)

    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              2
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
                   tablename                    |                                                                                                       indexdef
---------------------------------------------------------------------
 colocated_dist_table_8999116                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8999116 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8999116 USING btree (measureid)
 colocated_partitioned_table_2020_01_01_8999120 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8999120 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8999120 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8999118            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8999118 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8999118 USING btree (measureid, eventdatetime)
 reference_table_8970011                        | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
 sensors_2020_01_01_8999104                     | CREATE INDEX index_on_child_8999104 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999104 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8999104                     | CREATE INDEX sensors_2020_01_01_lower_idx_8999104 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999104 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8999104                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8999104 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999104 USING btree (measureid, eventdatetime, measure_data)
 sensors_8999100                                | CREATE INDEX index_on_parent_8999100 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999100 USING btree (lower((measureid)::text))
 sensors_8999100                                | CREATE UNIQUE INDEX sensors_pkey_8999100 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999100 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8999106                           | CREATE INDEX sensors_news_lower_idx_8999106 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999106 USING btree (lower((measureid)::text))
 sensors_news_8999106                           | CREATE UNIQUE INDEX sensors_news_pkey_8999106 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999106 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8999102                            | CREATE INDEX sensors_old_lower_idx_8999102 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999102 USING btree (lower((measureid)::text))
 sensors_old_8999102                            | CREATE UNIQUE INDEX sensors_old_pkey_8999102 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999102 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8999112             | CREATE INDEX index_on_child_columnar_8999112 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999112 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8999112             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8999112 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999112 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8999112             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8999112 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999112 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8999108                        | CREATE INDEX index_on_parent_columnar_8999108 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999108 USING btree (lower((measureid)::text))
 sensorscolumnar_8999108                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8999108 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999108 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8999114                   | CREATE INDEX sensorscolumnar_news_lower_idx_8999114 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999114 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8999114                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8999114 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999114 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8999110                    | CREATE INDEX sensorscolumnar_old_lower_idx_8999110 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999110 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8999110                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8999110 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999110 USING btree (measureid, eventdatetime, measure_data)
(22 rows)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
   stxname
---------------------------------------------------------------------
 s1
 s1_8999100
 s1_c
 s1_c_8999108
 s2
 s2_8999104
 s2_c
 s2_c_8999112
(8 rows)

    \c - - - :worker_2_port
    SET search_path TO "citus_split_non_blocking_schema_columnar_partitioned";
    SET citus.show_shards_for_app_name_prefixes = '*';
    SELECT tbl.relname, fk."Constraint", fk."Definition"
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND fk."Constraint" NOT LIKE 'sensors%' AND fk."Constraint" NOT LIKE '%to\_parent%\_1'
            ORDER BY 1, 2;
          relname           |             Constraint             |                                                         Definition
---------------------------------------------------------------------
 sensors_2020_01_01_8999005 | fkey_from_child_to_child_8999005   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_dist_8999005    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_parent_8999005  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_child_to_ref_8999005     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_2020_01_01_8999005 | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999105 | fkey_from_child_to_child_8999105   | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999121(eventdatetime, measureid)
 sensors_2020_01_01_8999105 | fkey_from_child_to_dist_8999105    | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999117(measureid)
 sensors_2020_01_01_8999105 | fkey_from_child_to_parent_8999105  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999119(eventdatetime, measureid)
 sensors_2020_01_01_8999105 | fkey_from_child_to_ref_8999105     | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_2020_01_01_8999105 | fkey_from_parent_to_child_8999101  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999121(eventdatetime, measureid)
 sensors_2020_01_01_8999105 | fkey_from_parent_to_dist_8999101   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999117(measureid)
 sensors_2020_01_01_8999105 | fkey_from_parent_to_parent_8999101 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999119(eventdatetime, measureid)
 sensors_2020_01_01_8999105 | fkey_from_parent_to_ref_8999101    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8999001            | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_8999001            | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_8999001            | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_8999001            | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_8999101            | fkey_from_parent_to_child_8999101  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999121(eventdatetime, measureid)
 sensors_8999101            | fkey_from_parent_to_dist_8999101   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999117(measureid)
 sensors_8999101            | fkey_from_parent_to_parent_8999101 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999119(eventdatetime, measureid)
 sensors_8999101            | fkey_from_parent_to_ref_8999101    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8999007       | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_news_8999007       | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_news_8999007       | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_news_8999007       | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_news_8999107       | fkey_from_parent_to_child_8999101  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999121(eventdatetime, measureid)
 sensors_news_8999107       | fkey_from_parent_to_dist_8999101   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999117(measureid)
 sensors_news_8999107       | fkey_from_parent_to_parent_8999101 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999119(eventdatetime, measureid)
 sensors_news_8999107       | fkey_from_parent_to_ref_8999101    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8999003        | fkey_from_parent_to_child_8999001  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999021(eventdatetime, measureid)
 sensors_old_8999003        | fkey_from_parent_to_dist_8999001   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999017(measureid)
 sensors_old_8999003        | fkey_from_parent_to_parent_8999001 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999019(eventdatetime, measureid)
 sensors_old_8999003        | fkey_from_parent_to_ref_8999001    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
 sensors_old_8999103        | fkey_from_parent_to_child_8999101  | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_2020_01_01_8999121(eventdatetime, measureid)
 sensors_old_8999103        | fkey_from_parent_to_dist_8999101   | FOREIGN KEY (measureid) REFERENCES colocated_dist_table_8999117(measureid)
 sensors_old_8999103        | fkey_from_parent_to_parent_8999101 | FOREIGN KEY (eventdatetime, measureid) REFERENCES colocated_partitioned_table_8999119(eventdatetime, measureid)
 sensors_old_8999103        | fkey_from_parent_to_ref_8999101    | FOREIGN KEY (measureid) REFERENCES reference_table_8970011(measureid)
(40 rows)

    SELECT count(*) AS generated_child_fk_constraints
            FROM pg_catalog.pg_class tbl
            JOIN public.table_fkeys fk on tbl.oid = fk.relid
            WHERE tbl.relname like '%_89%'
            AND (fk."Constraint" LIKE 'sensors%' OR fk."Constraint" LIKE '%to\_parent%\_1');
 generated_child_fk_constraints
---------------------------------------------------------------------
                              4
(1 row)

    SELECT tablename, indexdef FROM pg_indexes WHERE tablename like '%_89%' ORDER BY 1,2;
                   tablename                    |                                                                                                       indexdef
---------------------------------------------------------------------
 colocated_dist_table_8999017                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8999017 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8999017 USING btree (measureid)
 colocated_dist_table_8999117                   | CREATE UNIQUE INDEX colocated_dist_table_pkey_8999117 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table_8999117 USING btree (measureid)
 colocated_partitioned_table_2020_01_01_8999021 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8999021 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8999021 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_2020_01_01_8999121 | CREATE UNIQUE INDEX colocated_partitioned_table_2020_01_01_pkey_8999121 ON citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_2020_01_01_8999121 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8999019            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8999019 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8999019 USING btree (measureid, eventdatetime)
 colocated_partitioned_table_8999119            | CREATE UNIQUE INDEX colocated_partitioned_table_pkey_8999119 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table_8999119 USING btree (measureid, eventdatetime)
 reference_table_8970011                        | CREATE UNIQUE INDEX reference_table_pkey_8970011 ON citus_split_non_blocking_schema_columnar_partitioned.reference_table_8970011 USING btree (measureid)
 sensors_2020_01_01_8999005                     | CREATE INDEX index_on_child_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8999005                     | CREATE INDEX sensors_2020_01_01_lower_idx_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8999005                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8999005 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999005 USING btree (measureid, eventdatetime, measure_data)
 sensors_2020_01_01_8999105                     | CREATE INDEX index_on_child_8999105 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999105 USING btree (lower((measure_data)::text))
 sensors_2020_01_01_8999105                     | CREATE INDEX sensors_2020_01_01_lower_idx_8999105 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999105 USING btree (lower((measureid)::text))
 sensors_2020_01_01_8999105                     | CREATE UNIQUE INDEX sensors_2020_01_01_pkey_8999105 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_2020_01_01_8999105 USING btree (measureid, eventdatetime, measure_data)
 sensors_8999001                                | CREATE INDEX index_on_parent_8999001 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999001 USING btree (lower((measureid)::text))
 sensors_8999001                                | CREATE UNIQUE INDEX sensors_pkey_8999001 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999001 USING btree (measureid, eventdatetime, measure_data)
 sensors_8999101                                | CREATE INDEX index_on_parent_8999101 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999101 USING btree (lower((measureid)::text))
 sensors_8999101                                | CREATE UNIQUE INDEX sensors_pkey_8999101 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensors_8999101 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8999007                           | CREATE INDEX sensors_news_lower_idx_8999007 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999007 USING btree (lower((measureid)::text))
 sensors_news_8999007                           | CREATE UNIQUE INDEX sensors_news_pkey_8999007 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999007 USING btree (measureid, eventdatetime, measure_data)
 sensors_news_8999107                           | CREATE INDEX sensors_news_lower_idx_8999107 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999107 USING btree (lower((measureid)::text))
 sensors_news_8999107                           | CREATE UNIQUE INDEX sensors_news_pkey_8999107 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_news_8999107 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8999003                            | CREATE INDEX sensors_old_lower_idx_8999003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999003 USING btree (lower((measureid)::text))
 sensors_old_8999003                            | CREATE UNIQUE INDEX sensors_old_pkey_8999003 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999003 USING btree (measureid, eventdatetime, measure_data)
 sensors_old_8999103                            | CREATE INDEX sensors_old_lower_idx_8999103 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999103 USING btree (lower((measureid)::text))
 sensors_old_8999103                            | CREATE UNIQUE INDEX sensors_old_pkey_8999103 ON citus_split_non_blocking_schema_columnar_partitioned.sensors_old_8999103 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8999013             | CREATE INDEX index_on_child_columnar_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8999013             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8999013             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8999013 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999013 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_2020_01_01_8999113             | CREATE INDEX index_on_child_columnar_8999113 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999113 USING btree (lower((measure_data)::text))
 sensorscolumnar_2020_01_01_8999113             | CREATE INDEX sensorscolumnar_2020_01_01_lower_idx_8999113 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999113 USING btree (lower((measureid)::text))
 sensorscolumnar_2020_01_01_8999113             | CREATE UNIQUE INDEX sensorscolumnar_2020_01_01_pkey_8999113 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_2020_01_01_8999113 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8999009                        | CREATE INDEX index_on_parent_columnar_8999009 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999009 USING btree (lower((measureid)::text))
 sensorscolumnar_8999009                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8999009 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999009 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_8999109                        | CREATE INDEX index_on_parent_columnar_8999109 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999109 USING btree (lower((measureid)::text))
 sensorscolumnar_8999109                        | CREATE UNIQUE INDEX sensorscolumnar_pkey_8999109 ON ONLY citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_8999109 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8999015                   | CREATE INDEX sensorscolumnar_news_lower_idx_8999015 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999015 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8999015                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8999015 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999015 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_news_8999115                   | CREATE INDEX sensorscolumnar_news_lower_idx_8999115 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999115 USING btree (lower((measureid)::text))
 sensorscolumnar_news_8999115                   | CREATE UNIQUE INDEX sensorscolumnar_news_pkey_8999115 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_news_8999115 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8999011                    | CREATE INDEX sensorscolumnar_old_lower_idx_8999011 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999011 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8999011                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8999011 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999011 USING btree (measureid, eventdatetime, measure_data)
 sensorscolumnar_old_8999111                    | CREATE INDEX sensorscolumnar_old_lower_idx_8999111 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999111 USING btree (lower((measureid)::text))
 sensorscolumnar_old_8999111                    | CREATE UNIQUE INDEX sensorscolumnar_old_pkey_8999111 ON citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar_old_8999111 USING btree (measureid, eventdatetime, measure_data)
(43 rows)

    SELECT stxname FROM pg_statistic_ext
    WHERE stxnamespace IN (
        SELECT oid
        FROM pg_namespace
        WHERE nspname IN ('citus_split_non_blocking_schema_columnar_partitioned')
    )
    ORDER BY stxname ASC;
   stxname
---------------------------------------------------------------------
 s1
 s1_8999001
 s1_8999101
 s1_c
 s1_c_8999009
 s1_c_8999109
 s2
 s2_8999005
 s2_8999105
 s2_c
 s2_c_8999013
 s2_c_8999113
(12 rows)

-- END: Show the updated state on workers
--BEGIN : Cleanup
    \c - postgres - :master_port
    ALTER SYSTEM RESET citus.defer_shard_delete_interval;
    SELECT pg_reload_conf();
 pg_reload_conf
---------------------------------------------------------------------
 t
(1 row)

    DROP SCHEMA "citus_split_non_blocking_schema_columnar_partitioned" CASCADE;
NOTICE:  drop cascades to 5 other objects
DETAIL:  drop cascades to table citus_split_non_blocking_schema_columnar_partitioned.sensors
drop cascades to table citus_split_non_blocking_schema_columnar_partitioned.sensorscolumnar
drop cascades to table citus_split_non_blocking_schema_columnar_partitioned.colocated_dist_table
drop cascades to table citus_split_non_blocking_schema_columnar_partitioned.colocated_partitioned_table
drop cascades to table citus_split_non_blocking_schema_columnar_partitioned.reference_table
--END : Cleanup
SET client_min_messages TO WARNING;
DROP EXTENSION citus_columnar CASCADE;
