@@ -1441,28 +1441,46 @@ SELECT pathman.replace_hash_partition('test.hash_rel_0', 'test.hash_rel_extern')
14411441 test.hash_rel_extern
14421442(1 row)
14431443
1444- \d+ test.hash_rel_0
1445- Table "test.hash_rel_0"
1446- Column | Type | Modifiers | Storage | Stats target | Description
1447- --------+---------+------------------------------------------------------------+---------+--------------+-------------
1448- id | integer | not null default nextval('test.hash_rel_id_seq'::regclass) | plain | |
1449- value | integer | not null | plain | |
1450- abc | integer | | plain | |
1451- Indexes:
1452- "hash_rel_0_pkey" PRIMARY KEY, btree (id)
1453-
1454- \d+ test.hash_rel_extern
1455- Table "test.hash_rel_extern"
1456- Column | Type | Modifiers | Storage | Stats target | Description
1457- --------+---------+------------------------------------------------------------+---------+--------------+-------------
1458- id | integer | not null default nextval('test.hash_rel_id_seq'::regclass) | plain | |
1459- value | integer | not null | plain | |
1460- abc | integer | | plain | |
1461- Indexes:
1462- "hash_rel_extern_pkey" PRIMARY KEY, btree (id)
1463- Check constraints:
1464- "pathman_hash_rel_extern_check" CHECK (pathman.get_hash_part_idx(hashint4(value), 3) = 0)
1465- Inherits: test.hash_rel
1444+ /* Check the consistency of test.hash_rel_0 and test.hash_rel_extern relations */
1445+ EXPLAIN(COSTS OFF) SELECT * FROM test.hash_rel;
1446+ QUERY PLAN
1447+ -----------------------------------
1448+ Append
1449+ -> Seq Scan on hash_rel_extern
1450+ -> Seq Scan on hash_rel_1
1451+ -> Seq Scan on hash_rel_2
1452+ (4 rows)
1453+
1454+ SELECT parent, partition, parttype
1455+ FROM pathman.pathman_partition_list
1456+ WHERE parent='test.hash_rel'::regclass
1457+ ORDER BY 2;
1458+ parent | partition | parttype
1459+ ---------------+----------------------+----------
1460+ test.hash_rel | test.hash_rel_1 | 1
1461+ test.hash_rel | test.hash_rel_2 | 1
1462+ test.hash_rel | test.hash_rel_extern | 1
1463+ (3 rows)
1464+
1465+ SELECT c.oid::regclass::text,
1466+ array_agg(pg_get_indexdef(i.indexrelid)) AS indexes,
1467+ array_agg(pg_get_triggerdef(t.oid)) AS triggers
1468+ FROM pg_class c
1469+ LEFT JOIN pg_index i ON c.oid=i.indrelid
1470+ LEFT JOIN pg_trigger t ON c.oid=t.tgrelid
1471+ WHERE c.oid IN ('test.hash_rel_0'::regclass, 'test.hash_rel_extern'::regclass)
1472+ GROUP BY 1 ORDER BY 1;
1473+ oid | indexes | triggers
1474+ ----------------------+---------------------------------------------------------------------------------------+----------
1475+ test.hash_rel_0 | {"CREATE UNIQUE INDEX hash_rel_0_pkey ON test.hash_rel_0 USING btree (id)"} | {NULL}
1476+ test.hash_rel_extern | {"CREATE UNIQUE INDEX hash_rel_extern_pkey ON test.hash_rel_extern USING btree (id)"} | {NULL}
1477+ (2 rows)
1478+
1479+ SELECT pathman.is_tuple_convertible('test.hash_rel_0', 'test.hash_rel_extern');
1480+ is_tuple_convertible
1481+ ----------------------
1482+ t
1483+ (1 row)
14661484
14671485INSERT INTO test.hash_rel SELECT * FROM test.hash_rel_0;
14681486DROP TABLE test.hash_rel_0;
0 commit comments