Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit862874b

Browse files
committed
tests for hash_replace_partition() added
1 parent6c863e3 commit862874b

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

‎expected/pathman_basic.out

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -920,13 +920,19 @@ Inherits: test.hash_rel
920920

921921
INSERT INTO test.hash_rel SELECT * FROM test.hash_rel_0;
922922
DROP TABLE test.hash_rel_0;
923-
EXPLAIN SELECT * FROM test.hash_rel;
924-
QUERY PLAN
925-
---------------------------------------------------------------------------------------------
926-
Append (cost=10000000000.00..30000000032.44 rows=2044 width=12)
927-
-> Seq Scan on hash_rel_extern (cost=10000000000.00..10000000030.40 rows=2040 width=12)
928-
-> Seq Scan on hash_rel_1 (cost=10000000000.00..10000000001.02 rows=2 width=12)
929-
-> Seq Scan on hash_rel_2 (cost=10000000000.00..10000000001.02 rows=2 width=12)
923+
/* Table with which we are replacing partition must have exact same structure */
924+
CREATE TABLE test.hash_rel_wrong(
925+
idINTEGER NOT NULL,
926+
valueINTEGER);
927+
SELECT pathman.replace_hash_partition('test.hash_rel_1', 'test.hash_rel_wrong');
928+
ERROR: partition must have the exact same structure as parent
929+
EXPLAIN (COSTS OFF) SELECT * FROM test.hash_rel;
930+
QUERY PLAN
931+
-----------------------------------
932+
Append
933+
-> Seq Scan on hash_rel_extern
934+
-> Seq Scan on hash_rel_1
935+
-> Seq Scan on hash_rel_2
930936
(4 rows)
931937

932938
/*
@@ -1508,7 +1514,7 @@ SELECT count(*) FROM bool_test WHERE b = false;
15081514
DROP TABLE bool_test CASCADE;
15091515
NOTICE: drop cascades to 3 other objects
15101516
DROP SCHEMA test CASCADE;
1511-
NOTICE: drop cascades to13 other objects
1517+
NOTICE: drop cascades to14 other objects
15121518
DROP EXTENSION pg_pathman CASCADE;
15131519
NOTICE: drop cascades to 3 other objects
15141520
DROP SCHEMA pathman CASCADE;

‎sql/pathman_basic.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ SELECT pathman.replace_hash_partition('test.hash_rel_0', 'test.hash_rel_extern')
243243
\d+test.hash_rel_extern
244244
INSERT INTOtest.hash_relSELECT*FROMtest.hash_rel_0;
245245
DROPTABLEtest.hash_rel_0;
246-
EXPLAINSELECT*FROMtest.hash_rel;
246+
/* Table with which we are replacing partition must have exact same structure*/
247+
CREATETABLEtest.hash_rel_wrong(
248+
idINTEGERNOT NULL,
249+
valueINTEGER);
250+
SELECTpathman.replace_hash_partition('test.hash_rel_1','test.hash_rel_wrong');
251+
EXPLAIN (COSTS OFF)SELECT*FROMtest.hash_rel;
247252

248253
/*
249254
* Clean up

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp