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

Commit10e9e1a

Browse files
committed
resolve conflicts caused by merge of 'rel_future_beta'
2 parents1d8c8cb +53e7c77 commit10e9e1a

31 files changed

+867
-409
lines changed

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ OBJS = src/init.o src/relation_info.o src/utils.o src/partition_filter.o \
1010
src/compat/pg_compat.o src/compat/relation_tags.o src/compat/expand_rte_hook.o\
1111
src/compat/rowmarks_fix.o$(WIN32RES)
1212

13-
PG_CPPFLAGS = -I$(CURDIR)/src/include
13+
overridePG_CPPFLAGS+= -I$(CURDIR)/src/include
1414

1515
EXTENSION = pg_pathman
1616

‎expected/pathman_basic.out‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@ CREATE TABLE test.hash_rel (
99
INSERT INTO test.hash_rel VALUES (1, 1);
1010
INSERT INTO test.hash_rel VALUES (2, 2);
1111
INSERT INTO test.hash_rel VALUES (3, 3);
12+
\set VERBOSITY default
1213
SELECT pathman.create_hash_partitions('test.hash_rel', 'value', 3);
13-
ERROR: partitioning key "value" must be marked NOT NULL
14+
ERROR: failed to analyze partitioning expression "value"
15+
DETAIL: column "value" should be marked NOT NULL
16+
CONTEXT: SQL statement "SELECT pathman.validate_expression(parent_relid, expression)"
17+
PL/pgSQL function pathman.prepare_for_partitioning(regclass,text,boolean) line 9 at PERFORM
18+
SQL statement "SELECT pathman.prepare_for_partitioning(parent_relid,
19+
expression,
20+
partition_data)"
21+
PL/pgSQL function pathman.create_hash_partitions(regclass,text,integer,boolean,text[],text[]) line 4 at PERFORM
22+
\set VERBOSITY terse
1423
ALTER TABLE test.hash_rel ALTER COLUMN value SET NOT NULL;
1524
SELECT pathman.create_hash_partitions('test.hash_rel', 'value', 3, partition_data:=false);
1625
create_hash_partitions
@@ -129,8 +138,17 @@ CREATE TABLE test.range_rel (
129138
CREATE INDEX ON test.range_rel (dt);
130139
INSERT INTO test.range_rel (dt, txt)
131140
SELECT g, md5(g::TEXT) FROM generate_series('2015-01-01', '2015-04-30', '1 day'::interval) as g;
141+
\set VERBOSITY default
132142
SELECT pathman.create_range_partitions('test.range_rel', 'dt', '2015-01-01'::DATE, '1 month'::INTERVAL);
133-
ERROR: partitioning key "dt" must be marked NOT NULL
143+
ERROR: failed to analyze partitioning expression "dt"
144+
DETAIL: column "dt" should be marked NOT NULL
145+
CONTEXT: SQL statement "SELECT pathman.validate_expression(parent_relid, expression)"
146+
PL/pgSQL function pathman.prepare_for_partitioning(regclass,text,boolean) line 9 at PERFORM
147+
SQL statement "SELECT pathman.prepare_for_partitioning(parent_relid,
148+
expression,
149+
partition_data)"
150+
PL/pgSQL function pathman.create_range_partitions(regclass,text,anyelement,interval,integer,boolean) line 12 at PERFORM
151+
\set VERBOSITY terse
134152
ALTER TABLE test.range_rel ALTER COLUMN dt SET NOT NULL;
135153
SELECT pathman.create_range_partitions('test.range_rel', 'dt', '2015-01-01'::DATE, '1 month'::INTERVAL, 2);
136154
ERROR: not enough partitions to fit all values of "dt"

‎expected/pathman_calamity.out‎

Lines changed: 128 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ ERROR: 'parttype' should not be NULL
280280
SELECT validate_interval_value('pg_class', 'oid', 1, 'HASH', NULL);/* not ok */
281281
ERROR: interval should be NULL for HASH partitioned table
282282
SELECT validate_interval_value('pg_class', 'expr', 2, '1 mon', NULL);/* not ok */
283-
ERROR:cannot find type name for attribute"expr" of relation "pg_class"
283+
ERROR:failed to analyze partitioning expression"expr"
284284
SELECT validate_interval_value('pg_class', 'expr', 2, NULL, 'cooked_expr');/* not ok */
285285
ERROR: unrecognized token: "cooked_expr"
286286
SELECT validate_interval_value('pg_class', 'EXPR', 1, 'HASH', NULL);/* not ok */
287-
ERROR:cannot find type name for attribute "expr" of relation "pg_class"
287+
ERROR:failed to analyze partitioning expression "EXPR"
288288
/* check function validate_relname() */
289289
SELECT validate_relname('calamity.part_test');
290290
validate_relname
@@ -304,7 +304,7 @@ ERROR: 'relid' should not be NULL
304304
SELECT validate_expression('calamity.part_test', NULL);/* not ok */
305305
ERROR: 'expression' should not be NULL
306306
SELECT validate_expression('calamity.part_test', 'valval');/* not ok */
307-
ERROR:cannot find type name for attribute"valval" of relation "part_test"
307+
ERROR:failed to analyze partitioning expression"valval"
308308
SELECT validate_expression('calamity.part_test', 'random()');/* not ok */
309309
ERROR: failed to analyze partitioning expression "random()"
310310
SELECT validate_expression('calamity.part_test', 'val');/* OK */
@@ -580,7 +580,7 @@ ERROR: relation "0" does not exist
580580
SELECT add_to_pathman_config('calamity.part_test', NULL);/* no expr */
581581
ERROR: 'expression' should not be NULL
582582
SELECT add_to_pathman_config('calamity.part_test', 'V_A_L');/* wrong expr */
583-
ERROR:cannot find type name for attribute "v_a_l" of relation "part_test"
583+
ERROR:failed to analyze partitioning expression "V_A_L"
584584
SELECT add_to_pathman_config('calamity.part_test', 'val');/* OK */
585585
add_to_pathman_config
586586
-----------------------
@@ -851,9 +851,7 @@ DROP EXTENSION pg_pathman;
851851
*/
852852
CREATE SCHEMA calamity;
853853
CREATE EXTENSION pg_pathman;
854-
/* Change this setting for code coverage */
855-
SET pg_pathman.enable_bounds_cache = false;
856-
/* check view pathman_cache_stats */
854+
/* check that cache loading is lazy */
857855
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
858856
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
859857
create_range_partitions
@@ -870,22 +868,54 @@ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
870868
partition parents cache | 0
871869
(4 rows)
872870

873-
SELECT drop_partitions('calamity.test_pathman_cache_stats');
874-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_1
875-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_2
876-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_3
877-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_4
878-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_5
879-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_6
880-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_7
881-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_8
882-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_9
883-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_10
884-
drop_partitions
885-
-----------------
886-
10
871+
DROP TABLE calamity.test_pathman_cache_stats CASCADE;
872+
NOTICE: drop cascades to 11 other objects
873+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
874+
context | entries
875+
--------------------------+---------
876+
maintenance | 0
877+
partition bounds cache | 0
878+
partition dispatch cache | 0
879+
partition parents cache | 0
880+
(4 rows)
881+
882+
/* Change this setting for code coverage */
883+
SET pg_pathman.enable_bounds_cache = false;
884+
/* check view pathman_cache_stats (bounds cache disabled) */
885+
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
886+
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
887+
create_range_partitions
888+
-------------------------
889+
10
887890
(1 row)
888891

892+
EXPLAIN (COSTS OFF) SELECT * FROM calamity.test_pathman_cache_stats;
893+
QUERY PLAN
894+
-----------------------------------------------
895+
Append
896+
-> Seq Scan on test_pathman_cache_stats_1
897+
-> Seq Scan on test_pathman_cache_stats_2
898+
-> Seq Scan on test_pathman_cache_stats_3
899+
-> Seq Scan on test_pathman_cache_stats_4
900+
-> Seq Scan on test_pathman_cache_stats_5
901+
-> Seq Scan on test_pathman_cache_stats_6
902+
-> Seq Scan on test_pathman_cache_stats_7
903+
-> Seq Scan on test_pathman_cache_stats_8
904+
-> Seq Scan on test_pathman_cache_stats_9
905+
-> Seq Scan on test_pathman_cache_stats_10
906+
(11 rows)
907+
908+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
909+
context | entries
910+
--------------------------+---------
911+
maintenance | 0
912+
partition bounds cache | 0
913+
partition dispatch cache | 1
914+
partition parents cache | 10
915+
(4 rows)
916+
917+
DROP TABLE calamity.test_pathman_cache_stats CASCADE;
918+
NOTICE: drop cascades to 11 other objects
889919
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
890920
context | entries
891921
--------------------------+---------
@@ -895,42 +925,102 @@ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
895925
partition parents cache | 0
896926
(4 rows)
897927

898-
DROP TABLE calamity.test_pathman_cache_stats;
899928
/* Restore this GUC */
900929
SET pg_pathman.enable_bounds_cache = true;
901-
/* check view pathman_cache_stats (one more time) */
930+
/* check view pathman_cache_stats (bounds cache enabled) */
902931
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
903932
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
904933
create_range_partitions
905934
-------------------------
906935
10
907936
(1 row)
908937

938+
EXPLAIN (COSTS OFF) SELECT * FROM calamity.test_pathman_cache_stats;
939+
QUERY PLAN
940+
-----------------------------------------------
941+
Append
942+
-> Seq Scan on test_pathman_cache_stats_1
943+
-> Seq Scan on test_pathman_cache_stats_2
944+
-> Seq Scan on test_pathman_cache_stats_3
945+
-> Seq Scan on test_pathman_cache_stats_4
946+
-> Seq Scan on test_pathman_cache_stats_5
947+
-> Seq Scan on test_pathman_cache_stats_6
948+
-> Seq Scan on test_pathman_cache_stats_7
949+
-> Seq Scan on test_pathman_cache_stats_8
950+
-> Seq Scan on test_pathman_cache_stats_9
951+
-> Seq Scan on test_pathman_cache_stats_10
952+
(11 rows)
953+
909954
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
910955
context | entries
911956
--------------------------+---------
912957
maintenance | 0
913-
partition bounds cache | 0
958+
partition bounds cache |10
914959
partition dispatch cache | 1
960+
partition parents cache | 10
961+
(4 rows)
962+
963+
DROP TABLE calamity.test_pathman_cache_stats CASCADE;
964+
NOTICE: drop cascades to 11 other objects
965+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
966+
context | entries
967+
--------------------------+---------
968+
maintenance | 0
969+
partition bounds cache | 0
970+
partition dispatch cache | 0
915971
partition parents cache | 0
916972
(4 rows)
917973

918-
SELECT drop_partitions('calamity.test_pathman_cache_stats');
919-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_1
920-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_2
921-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_3
922-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_4
923-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_5
924-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_6
925-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_7
926-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_8
927-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_9
928-
NOTICE: 0 rows copied from calamity.test_pathman_cache_stats_10
929-
drop_partitions
930-
-----------------
931-
10
974+
/* check that parents cache has been flushed after partition was dropped */
975+
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
976+
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
977+
create_range_partitions
978+
-------------------------
979+
10
932980
(1 row)
933981

982+
EXPLAIN (COSTS OFF) SELECT * FROM calamity.test_pathman_cache_stats;
983+
QUERY PLAN
984+
-----------------------------------------------
985+
Append
986+
-> Seq Scan on test_pathman_cache_stats_1
987+
-> Seq Scan on test_pathman_cache_stats_2
988+
-> Seq Scan on test_pathman_cache_stats_3
989+
-> Seq Scan on test_pathman_cache_stats_4
990+
-> Seq Scan on test_pathman_cache_stats_5
991+
-> Seq Scan on test_pathman_cache_stats_6
992+
-> Seq Scan on test_pathman_cache_stats_7
993+
-> Seq Scan on test_pathman_cache_stats_8
994+
-> Seq Scan on test_pathman_cache_stats_9
995+
-> Seq Scan on test_pathman_cache_stats_10
996+
(11 rows)
997+
998+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
999+
context | entries
1000+
--------------------------+---------
1001+
maintenance | 0
1002+
partition bounds cache | 10
1003+
partition dispatch cache | 1
1004+
partition parents cache | 10
1005+
(4 rows)
1006+
1007+
SELECT drop_range_partition('calamity.test_pathman_cache_stats_1');
1008+
drop_range_partition
1009+
-------------------------------------
1010+
calamity.test_pathman_cache_stats_1
1011+
(1 row)
1012+
1013+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
1014+
context | entries
1015+
--------------------------+---------
1016+
maintenance | 0
1017+
partition bounds cache | 9
1018+
partition dispatch cache | 1
1019+
partition parents cache | 0
1020+
(4 rows)
1021+
1022+
DROP TABLE calamity.test_pathman_cache_stats CASCADE;
1023+
NOTICE: drop cascades to 10 other objects
9341024
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
9351025
context | entries
9361026
--------------------------+---------
@@ -940,7 +1030,6 @@ SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
9401030
partition parents cache | 0
9411031
(4 rows)
9421032

943-
DROP TABLE calamity.test_pathman_cache_stats;
9441033
DROP SCHEMA calamity CASCADE;
9451034
DROP EXTENSION pg_pathman;
9461035
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp