- Notifications
You must be signed in to change notification settings - Fork67
PGPRO 7870#266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
PGPRO 7870#266
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
150 changes: 150 additions & 0 deletionsexpected/pathman_cache_pranks.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
237 changes: 237 additions & 0 deletionsexpected/pathman_cache_pranks_1.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
\set VERBOSITY terse | ||
-- is pathman (caches, in particular) strong enough to carry out this? | ||
SET search_path = 'public'; | ||
-- make sure nothing breaks on disable/enable when nothing was initialized yet | ||
SET pg_pathman.enable = false; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled | ||
SET pg_pathman.enable = true; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled | ||
-- wobble with create-drop ext: tests cached relids sanity | ||
CREATE EXTENSION pg_pathman; | ||
SET pg_pathman.enable = f; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled | ||
DROP EXTENSION pg_pathman; | ||
CREATE EXTENSION pg_pathman; | ||
SET pg_pathman.enable = true; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled | ||
DROP EXTENSION pg_pathman; | ||
CREATE EXTENSION pg_pathman; | ||
DROP EXTENSION pg_pathman; | ||
-- create it for further tests | ||
CREATE EXTENSION pg_pathman; | ||
-- 079797e0d5 | ||
CREATE TABLE part_test(val serial); | ||
INSERT INTO part_test SELECT generate_series(1, 30); | ||
SELECT create_range_partitions('part_test', 'val', 1, 10); | ||
create_range_partitions | ||
------------------------- | ||
3 | ||
(1 row) | ||
SELECT set_interval('part_test', 100); | ||
set_interval | ||
-------------- | ||
(1 row) | ||
DELETE FROM pathman_config WHERE partrel = 'part_test'::REGCLASS; | ||
SELECT drop_partitions('part_test'); | ||
ERROR: table "part_test" has no partitions | ||
SELECT disable_pathman_for('part_test'); | ||
disable_pathman_for | ||
--------------------- | ||
(1 row) | ||
CREATE TABLE wrong_partition (LIKE part_test) INHERITS (part_test); | ||
NOTICE: merging column "val" with inherited definition | ||
SELECT add_to_pathman_config('part_test', 'val', '10'); | ||
ERROR: constraint "pathman_wrong_partition_check" of partition "wrong_partition" does not exist | ||
SELECT add_to_pathman_config('part_test', 'val'); | ||
ERROR: wrong constraint format for HASH partition "part_test_1" | ||
DROP TABLE part_test CASCADE; | ||
NOTICE: drop cascades to 5 other objects | ||
-- | ||
-- 85fc5ccf121 | ||
CREATE TABLE part_test(val serial); | ||
INSERT INTO part_test SELECT generate_series(1, 3000); | ||
SELECT create_range_partitions('part_test', 'val', 1, 10); | ||
create_range_partitions | ||
------------------------- | ||
300 | ||
(1 row) | ||
SELECT append_range_partition('part_test'); | ||
append_range_partition | ||
------------------------ | ||
part_test_301 | ||
(1 row) | ||
DELETE FROM part_test; | ||
SELECT create_single_range_partition('part_test', NULL::INT4, NULL);/* not ok */ | ||
ERROR: cannot create partition with range (-inf, +inf) | ||
DELETE FROM pathman_config WHERE partrel = 'part_test'::REGCLASS; | ||
SELECT create_hash_partitions('part_test', 'val', 2, partition_names := ARRAY[]::TEXT[]); /* not ok */ | ||
ERROR: can't partition table "part_test" with existing children | ||
DROP TABLE part_test CASCADE; | ||
NOTICE: drop cascades to 302 other objects | ||
-- | ||
-- | ||
-- PGPRO-7870 | ||
-- Added error for case executing prepared query after DROP/CREATE EXTENSION. | ||
-- | ||
-- DROP/CREATE extension | ||
CREATE TABLE part_test(a INT4 NOT NULL, b INT4); | ||
PREPARE q(int4) AS SELECT * FROM part_test WHERE a > ALL (array[$1, 898]); | ||
SELECT create_range_partitions('part_test', 'a', 1, 100, 10); | ||
create_range_partitions | ||
------------------------- | ||
10 | ||
(1 row) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
DROP EXTENSION pg_pathman; | ||
CREATE EXTENSION pg_pathman; | ||
EXECUTE q(1); | ||
ERROR: table "part_test" is not partitioned | ||
DEALLOCATE q; | ||
DROP TABLE part_test CASCADE; | ||
NOTICE: drop cascades to 11 other objects | ||
-- DROP/CREATE disabled extension | ||
CREATE TABLE part_test(a INT4 NOT NULL, b INT4); | ||
PREPARE q(int4) AS SELECT * FROM part_test WHERE a > ALL (array[$1, 898]); | ||
SELECT create_range_partitions('part_test', 'a', 1, 100, 10); | ||
create_range_partitions | ||
------------------------- | ||
10 | ||
(1 row) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
SET pg_pathman.enable = f; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled | ||
DROP EXTENSION pg_pathman; | ||
CREATE EXTENSION pg_pathman; | ||
SET pg_pathman.enable = t; | ||
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled | ||
EXECUTE q(1); | ||
ERROR: table "part_test" is not partitioned | ||
DEALLOCATE q; | ||
DROP TABLE part_test CASCADE; | ||
NOTICE: drop cascades to 11 other objects | ||
-- DROP/CREATE extension in autonomous transaction | ||
CREATE TABLE part_test(a INT4 NOT NULL, b INT4); | ||
PREPARE q(int4) AS SELECT * FROM part_test WHERE a > ALL (array[$1, 198]); | ||
SELECT create_range_partitions('part_test', 'a', 1, 100, 2); | ||
create_range_partitions | ||
------------------------- | ||
2 | ||
(1 row) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
BEGIN; | ||
BEGIN AUTONOMOUS; | ||
ERROR: syntax error at or near "AUTONOMOUS" at character 7 | ||
DROP EXTENSION pg_pathman; | ||
ERROR: current transaction is aborted, commands ignored until end of transaction block | ||
CREATE EXTENSION pg_pathman; | ||
ERROR: current transaction is aborted, commands ignored until end of transaction block | ||
COMMIT; | ||
COMMIT; | ||
WARNING: there is no transaction in progress | ||
EXECUTE q(1); | ||
a | b | ||
---+--- | ||
(0 rows) | ||
DEALLOCATE q; | ||
DROP TABLE part_test CASCADE; | ||
NOTICE: drop cascades to 3 other objects | ||
-- finalize | ||
DROP EXTENSION pg_pathman; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.