|
| 1 | +\set VERBOSITY terse |
| 2 | +-- is pathman (caches, in particular) strong enough to carry out this? |
| 3 | +SET search_path = 'public'; |
| 4 | +-- wobble with create-drop ext: tests cached relids sanity |
| 5 | +CREATE EXTENSION pg_pathman; |
| 6 | +SET pg_pathman.enable = f; |
| 7 | +NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled |
| 8 | +DROP EXTENSION pg_pathman; |
| 9 | +CREATE EXTENSION pg_pathman; |
| 10 | +SET pg_pathman.enable = true; |
| 11 | +NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled |
| 12 | +DROP EXTENSION pg_pathman; |
| 13 | +CREATE EXTENSION pg_pathman; |
| 14 | +DROP EXTENSION pg_pathman; |
| 15 | +-- create it for further tests |
| 16 | +CREATE EXTENSION pg_pathman; |
| 17 | +-- 079797e0d5 |
| 18 | +CREATE TABLE part_test(val serial); |
| 19 | +INSERT INTO part_test SELECT generate_series(1, 30); |
| 20 | +SELECT create_range_partitions('part_test', 'val', 1, 10); |
| 21 | + create_range_partitions |
| 22 | +------------------------- |
| 23 | + 3 |
| 24 | +(1 row) |
| 25 | + |
| 26 | +SELECT set_interval('part_test', 100); |
| 27 | + set_interval |
| 28 | +-------------- |
| 29 | + |
| 30 | +(1 row) |
| 31 | + |
| 32 | +DELETE FROM pathman_config WHERE partrel = 'part_test'::REGCLASS; |
| 33 | +SELECT drop_partitions('part_test'); |
| 34 | +ERROR: table "part_test" has no partitions |
| 35 | +SELECT disable_pathman_for('part_test'); |
| 36 | + disable_pathman_for |
| 37 | +--------------------- |
| 38 | + |
| 39 | +(1 row) |
| 40 | + |
| 41 | +CREATE TABLE wrong_partition (LIKE part_test) INHERITS (part_test); |
| 42 | +NOTICE: merging column "val" with inherited definition |
| 43 | +SELECT add_to_pathman_config('part_test', 'val', '10'); |
| 44 | +ERROR: constraint "pathman_wrong_partition_check" of partition "wrong_partition" does not exist |
| 45 | +SELECT add_to_pathman_config('part_test', 'val'); |
| 46 | +ERROR: wrong constraint format for HASH partition "part_test_1" |
| 47 | +DROP TABLE part_test CASCADE; |
| 48 | +NOTICE: drop cascades to 5 other objects |
| 49 | +-- |
| 50 | +-- 85fc5ccf121 |
| 51 | +CREATE TABLE part_test(val serial); |
| 52 | +INSERT INTO part_test SELECT generate_series(1, 3000); |
| 53 | +SELECT create_range_partitions('part_test', 'val', 1, 10); |
| 54 | + create_range_partitions |
| 55 | +------------------------- |
| 56 | + 300 |
| 57 | +(1 row) |
| 58 | + |
| 59 | +SELECT append_range_partition('part_test'); |
| 60 | + append_range_partition |
| 61 | +------------------------ |
| 62 | + part_test_301 |
| 63 | +(1 row) |
| 64 | + |
| 65 | +DELETE FROM part_test; |
| 66 | +SELECT create_single_range_partition('part_test', NULL::INT4, NULL);/* not ok */ |
| 67 | +ERROR: cannot create partition with range (-inf, +inf) |
| 68 | +DELETE FROM pathman_config WHERE partrel = 'part_test'::REGCLASS; |
| 69 | +SELECT create_hash_partitions('part_test', 'val', 2, partition_names := ARRAY[]::TEXT[]); /* not ok */ |
| 70 | +ERROR: can't partition table "part_test" with existing children |
| 71 | +DROP TABLE part_test CASCADE; |
| 72 | +NOTICE: drop cascades to 302 other objects |
| 73 | +-- |
| 74 | +-- finalize |
| 75 | +DROP EXTENSION pg_pathman; |