Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e836cb6

Browse files
committed
Merge branch 'PGPRO10' into PGPROEE10
2 parents 8be7aa0 + 78fa840 commit e836cb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6670
-2265
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
### IMPORTANT: make sure that you:
3+
4+
- are familiar with [known limitations](https://github.com/postgrespro/pg_pathman/wiki/Known-limitations).
5+
- checked the [faq](https://github.com/postgrespro/pg_pathman/wiki/What-the-FAQ) for common problems.
6+
-->
7+
8+
9+
### Problem description
10+
11+
Explain your problem here (it's always better to provide reproduction steps) ...
12+
13+
14+
15+
### Environment
16+
17+
<!-- Put the result of (SELECT * FROM pg_extension) below -->
18+
19+
<!-- Put the result of (SELECT version()) below -->
20+
21+
<!-- For Postgres Pro: put the result of (SELECT pgpro_version()) below -->
22+
23+
<!-- For Postgres Pro: put the result of (SELECT pgpro_edition()) below -->
24+
25+
<!-- For pg_pathman 1.4: put the result of (SELECT get_pathman_lib_version()) below -->
26+
27+
<!-- For pg_pathman 1.5: put the result of (SELECT pathman_version()) below -->
28+

contrib/pg_pathman/META.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pg_pathman",
33
"abstract": "Partitioning tool",
44
"description": "The `pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.",
5-
"version": "1.4.7",
5+
"version": "1.4.9",
66
"maintainer": [
77
"Ildar Musin <i.musin@postgrespro.ru>",
88
"Dmitry Ivanov <d.ivanov@postgrespro.ru>",
@@ -24,7 +24,7 @@
2424
"pg_pathman": {
2525
"file": "pg_pathman--1.4.sql",
2626
"docfile": "README.md",
27-
"version": "1.4.7",
27+
"version": "1.4.9",
2828
"abstract": "Partitioning tool"
2929
}
3030
},

contrib/pg_pathman/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OBJS = src/init.o src/relation_info.o src/utils.o src/partition_filter.o \
77
src/pl_funcs.o src/pl_range_funcs.o src/pl_hash_funcs.o src/pathman_workers.o \
88
src/hooks.o src/nodes_common.o src/xact_handling.o src/utility_stmt_hooking.o \
99
src/planner_tree_modification.o src/debug_print.o src/partition_creation.o \
10-
src/compat/pg_compat.o src/compat/relation_tags.o src/compat/rowmarks_fix.o \
10+
src/compat/pg_compat.o src/compat/rowmarks_fix.o \
1111
$(WIN32RES)
1212

1313
ifdef USE_PGXS

contrib/pg_pathman/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ More interesting features are yet to come. Stay tuned!
5353
* `RuntimeAppend` & `RuntimeMergeAppend` custom plan nodes to pick partitions at runtime;
5454
* `PartitionFilter`: an efficient drop-in replacement for INSERT triggers;
5555
* Automatic partition creation for new INSERTed data (only for RANGE partitioning);
56-
* Improved `COPY FROM\TO` statement that is able to insert rows directly into partitions;
56+
* Improved `COPY FROM` statement that is able to insert rows directly into partitions;
5757
* UPDATE triggers generation out of the box (will be replaced with custom nodes too);
5858
* User-defined callbacks for partition creation event handling;
5959
* Non-blocking concurrent table partitioning;

contrib/pg_pathman/expected/pathman_bgw.out

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ DECLARE
187187
i int4 := 0; -- protect from endless loop
188188
BEGIN
189189
LOOP
190+
-- get total number of processed rows
190191
SELECT processed
191192
FROM pathman_concurrent_part_tasks
192193
WHERE relid = 'test_bgw.conc_part'::regclass
@@ -200,9 +201,12 @@ BEGIN
200201

201202
ASSERT rows IS NOT NULL;
202203

203-
-- rows should increase!
204-
IF rows_old <= rows THEN
204+
IF rows_old = rows THEN
205205
i = i + 1;
206+
ELSIF rows < rows_old THEN
207+
RAISE EXCEPTION 'rows is decreasing: new %, old %', rows, rows_old;
208+
ELSIF rows > 500 THEN
209+
RAISE EXCEPTION 'processed % rows', rows;
206210
END IF;
207211
ELSE
208212
EXIT; -- exit loop

contrib/pg_pathman/expected/pathman_calamity.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SELECT debug_capture();
1212
SELECT get_pathman_lib_version();
1313
get_pathman_lib_version
1414
-------------------------
15-
10407
15+
10409
1616
(1 row)
1717

1818
set client_min_messages = NOTICE;

contrib/pg_pathman/expected/pathman_inserts.out

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,36 @@ INSERT INTO test_inserts.test_gap VALUES(15); /* not ok */
10321032
ERROR: cannot spawn a partition
10331033
DROP TABLE test_inserts.test_gap CASCADE;
10341034
NOTICE: drop cascades to 3 other objects
1035+
/* test a few "special" ONLY queries used in pg_repack */
1036+
CREATE TABLE test_inserts.test_special_only(val INT NOT NULL);
1037+
INSERT INTO test_inserts.test_special_only SELECT generate_series(1, 30);
1038+
SELECT create_hash_partitions('test_inserts.test_special_only', 'val', 4);
1039+
create_hash_partitions
1040+
------------------------
1041+
4
1042+
(1 row)
1043+
1044+
/* create table as select only */
1045+
CREATE TABLE test_inserts.special_1 AS SELECT * FROM ONLY test_inserts.test_special_only;
1046+
SELECT count(*) FROM test_inserts.special_1;
1047+
count
1048+
-------
1049+
0
1050+
(1 row)
1051+
1052+
DROP TABLE test_inserts.special_1;
1053+
/* insert into ... select only */
1054+
CREATE TABLE test_inserts.special_2 AS SELECT * FROM ONLY test_inserts.test_special_only WITH NO DATA;
1055+
INSERT INTO test_inserts.special_2 SELECT * FROM ONLY test_inserts.test_special_only;
1056+
SELECT count(*) FROM test_inserts.special_2;
1057+
count
1058+
-------
1059+
0
1060+
(1 row)
1061+
1062+
DROP TABLE test_inserts.special_2;
1063+
DROP TABLE test_inserts.test_special_only CASCADE;
1064+
NOTICE: drop cascades to 4 other objects
10351065
DROP SCHEMA test_inserts CASCADE;
10361066
NOTICE: drop cascades to 19 other objects
10371067
DROP EXTENSION pg_pathman CASCADE;

contrib/pg_pathman/expected/pathman_inserts_1.out

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,36 @@ INSERT INTO test_inserts.test_gap VALUES(15); /* not ok */
10321032
ERROR: cannot spawn a partition
10331033
DROP TABLE test_inserts.test_gap CASCADE;
10341034
NOTICE: drop cascades to 3 other objects
1035+
/* test a few "special" ONLY queries used in pg_repack */
1036+
CREATE TABLE test_inserts.test_special_only(val INT NOT NULL);
1037+
INSERT INTO test_inserts.test_special_only SELECT generate_series(1, 30);
1038+
SELECT create_hash_partitions('test_inserts.test_special_only', 'val', 4);
1039+
create_hash_partitions
1040+
------------------------
1041+
4
1042+
(1 row)
1043+
1044+
/* create table as select only */
1045+
CREATE TABLE test_inserts.special_1 AS SELECT * FROM ONLY test_inserts.test_special_only;
1046+
SELECT count(*) FROM test_inserts.special_1;
1047+
count
1048+
-------
1049+
0
1050+
(1 row)
1051+
1052+
DROP TABLE test_inserts.special_1;
1053+
/* insert into ... select only */
1054+
CREATE TABLE test_inserts.special_2 AS SELECT * FROM ONLY test_inserts.test_special_only WITH NO DATA;
1055+
INSERT INTO test_inserts.special_2 SELECT * FROM ONLY test_inserts.test_special_only;
1056+
SELECT count(*) FROM test_inserts.special_2;
1057+
count
1058+
-------
1059+
0
1060+
(1 row)
1061+
1062+
DROP TABLE test_inserts.special_2;
1063+
DROP TABLE test_inserts.test_special_only CASCADE;
1064+
NOTICE: drop cascades to 4 other objects
10351065
DROP SCHEMA test_inserts CASCADE;
10361066
NOTICE: drop cascades to 19 other objects
10371067
DROP EXTENSION pg_pathman CASCADE;

contrib/pg_pathman/expected/pathman_only.out

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,34 @@ UNION SELECT * FROM test_only.from_only_test;
137137
EXPLAIN (COSTS OFF)
138138
SELECT * FROM test_only.from_only_test a
139139
JOIN ONLY test_only.from_only_test b USING(val);
140-
ERROR: it is prohibited to apply ONLY modifier to partitioned tables which have already been mentioned without ONLY
140+
QUERY PLAN
141+
---------------------------------------------
142+
Nested Loop
143+
-> Seq Scan on from_only_test b
144+
-> Custom Scan (RuntimeAppend)
145+
Prune by: (b.val = a.val)
146+
-> Seq Scan on from_only_test_1 a
147+
Filter: (b.val = val)
148+
-> Seq Scan on from_only_test_2 a
149+
Filter: (b.val = val)
150+
-> Seq Scan on from_only_test_3 a
151+
Filter: (b.val = val)
152+
-> Seq Scan on from_only_test_4 a
153+
Filter: (b.val = val)
154+
-> Seq Scan on from_only_test_5 a
155+
Filter: (b.val = val)
156+
-> Seq Scan on from_only_test_6 a
157+
Filter: (b.val = val)
158+
-> Seq Scan on from_only_test_7 a
159+
Filter: (b.val = val)
160+
-> Seq Scan on from_only_test_8 a
161+
Filter: (b.val = val)
162+
-> Seq Scan on from_only_test_9 a
163+
Filter: (b.val = val)
164+
-> Seq Scan on from_only_test_10 a
165+
Filter: (b.val = val)
166+
(24 rows)
167+
141168
/* should be OK */
142169
EXPLAIN (COSTS OFF)
143170
WITH q1 AS (SELECT * FROM test_only.from_only_test),

0 commit comments

Comments
 (0)