Skip to content

Commit ec799be

Browse files
authored
Merge branch 'master' into upgrade_fix
2 parents 2cdb2bd + 92b69d8 commit ec799be

File tree

188 files changed

+20968
-1333
lines changed

Some content is hidden

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

188 files changed

+20968
-1333
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.deps
2-
isolation_output
32
results/*
43
regression.diffs
54
regression.out

Diff for: .travis.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
sudo: required
1+
os: linux
2+
3+
dist: focal
24

35
language: c
46

@@ -18,18 +20,15 @@ notifications:
1820
on_failure: always
1921

2022
env:
23+
- PG_VERSION=16 LEVEL=hardcore
24+
- PG_VERSION=16
25+
- PG_VERSION=15 LEVEL=hardcore
26+
- PG_VERSION=15
27+
- PG_VERSION=14 LEVEL=hardcore
28+
- PG_VERSION=14
29+
- PG_VERSION=13 LEVEL=hardcore
30+
- PG_VERSION=13
2131
- PG_VERSION=12 LEVEL=hardcore
2232
- PG_VERSION=12
2333
- PG_VERSION=11 LEVEL=hardcore
2434
- PG_VERSION=11
25-
- PG_VERSION=10 LEVEL=hardcore
26-
- PG_VERSION=10
27-
- PG_VERSION=9.6 LEVEL=hardcore
28-
- PG_VERSION=9.6
29-
- PG_VERSION=9.5 LEVEL=hardcore
30-
- PG_VERSION=9.5
31-
32-
matrix:
33-
allow_failures:
34-
- env: PG_VERSION=10 LEVEL=nightmare
35-
- env: PG_VERSION=9.6 LEVEL=nightmare

Diff for: Dockerfile.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ FROM postgres:${PG_VERSION}-alpine
22

33
# Install dependencies
44
RUN apk add --no-cache \
5-
openssl curl \
5+
openssl curl git patch \
66
cmocka-dev \
77
perl perl-ipc-run \
88
python3 python3-dev py3-virtualenv \
99
coreutils linux-headers \
1010
make musl-dev gcc bison flex \
1111
zlib-dev libedit-dev \
12-
clang clang-analyzer;
12+
pkgconf icu-dev clang clang15 clang-analyzer;
1313

1414
# Install fresh valgrind
1515
RUN apk add valgrind \
@@ -29,8 +29,8 @@ ADD . /pg/testdir
2929
# Grant privileges
3030
RUN chown -R postgres:postgres ${PGDATA} && \
3131
chown -R postgres:postgres /pg/testdir && \
32-
chmod a+rwx /usr/local/lib/postgresql && \
33-
chmod a+rwx /usr/local/share/postgresql/extension
32+
chmod a+rwx /usr/local/share/postgresql/extension && \
33+
find /usr/local/lib/postgresql -type d -print0 | xargs -0 chmod a+rwx
3434

3535
COPY run_tests.sh /run.sh
3636
RUN chmod 755 /run.sh

Diff for: META.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pg_pathman",
33
"abstract": "Fast partitioning tool for PostgreSQL",
44
"description": "pg_pathman provides optimized partitioning mechanism and functions to manage partitions.",
5-
"version": "1.5.11",
5+
"version": "1.5.12",
66
"maintainer": [
77
"Arseny Sher <[email protected]>"
88
],
@@ -22,7 +22,7 @@
2222
"pg_pathman": {
2323
"file": "pg_pathman--1.5.sql",
2424
"docfile": "README.md",
25-
"version": "1.5.11",
25+
"version": "1.5.12",
2626
"abstract": "Effective partitioning tool for PostgreSQL 9.5 and higher"
2727
}
2828
},

Diff for: Makefile

+20-15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ DATA = pg_pathman--1.0--1.1.sql \
3030

3131
PGFILEDESC = "pg_pathman - partitioning tool for PostgreSQL"
3232

33+
ifneq (pg_pathman,$(filter pg_pathman,$(PG_TEST_SKIP)))
3334
REGRESS = pathman_array_qual \
3435
pathman_basic \
3536
pathman_bgw \
@@ -61,25 +62,41 @@ REGRESS = pathman_array_qual \
6162
pathman_update_triggers \
6263
pathman_upd_del \
6364
pathman_utility_stmt \
64-
pathman_views
65+
pathman_views \
66+
pathman_CVE-2020-14350
6567

68+
REGRESS := $(filter-out pathman_upd_del, $(REGRESS))
69+
endif
70+
71+
ISOLATION = insert_nodes for_update rollback_on_create_partitions
6672

67-
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
73+
REGRESS_OPTS = --temp-config $(top_srcdir)/$(subdir)/conf.add
74+
ISOLATION_OPTS = --temp-config $(top_srcdir)/$(subdir)/conf.add
6875

69-
EXTRA_CLEAN = pg_pathman--$(EXTVERSION).sql ./isolation_output
76+
CMOCKA_EXTRA_CLEAN = missing_basic.o missing_list.o missing_stringinfo.o missing_bitmapset.o rangeset_tests.o rangeset_tests
77+
EXTRA_CLEAN = $(patsubst %,tests/cmocka/%, $(CMOCKA_EXTRA_CLEAN))
7078

7179
ifdef USE_PGXS
7280
PG_CONFIG=pg_config
7381
PGXS := $(shell $(PG_CONFIG) --pgxs)
7482
VNUM := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
7583

7684
# check for declarative syntax
85+
# this feature will not be ported to >=12
7786
ifeq ($(VNUM),$(filter 10% 11%,$(VNUM)))
7887
REGRESS += pathman_declarative
7988
OBJS += src/declarative.o
8089
override PG_CPPFLAGS += -DENABLE_DECLARATIVE
8190
endif
8291

92+
# We cannot run isolation test for versions 12,13 in PGXS case
93+
# because 'pg_isolation_regress' is not copied to install
94+
# directory, see src/test/isolation/Makefile
95+
ifeq ($(VNUM),$(filter 12% 13%,$(VNUM)))
96+
undefine ISOLATION
97+
undefine ISOLATION_OPTS
98+
endif
99+
83100
include $(PGXS)
84101
else
85102
subdir = contrib/pg_pathman
@@ -91,18 +108,6 @@ endif
91108
$(EXTENSION)--$(EXTVERSION).sql: init.sql hash.sql range.sql
92109
cat $^ > $@
93110

94-
ISOLATIONCHECKS=insert_nodes for_update rollback_on_create_partitions
95-
96-
submake-isolation:
97-
$(MAKE) -C $(top_builddir)/src/test/isolation all
98-
99-
isolationcheck: | submake-isolation
100-
$(MKDIR_P) isolation_output
101-
$(pg_isolation_regress_check) \
102-
--temp-config=$(top_srcdir)/$(subdir)/conf.add \
103-
--outputdir=./isolation_output \
104-
$(ISOLATIONCHECKS)
105-
106111
python_tests:
107112
$(MAKE) -C tests/python partitioning_tests CASE=$(CASE)
108113

Diff for: README.md

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
[![Build Status](https://travis-ci.org/postgrespro/pg_pathman.svg?branch=master)](https://travis-ci.org/postgrespro/pg_pathman)
1+
[![Build Status](https://travis-ci.com/postgrespro/pg_pathman.svg?branch=master)](https://travis-ci.com/postgrespro/pg_pathman)
22
[![PGXN version](https://badge.fury.io/pg/pg_pathman.svg)](https://badge.fury.io/pg/pg_pathman)
33
[![codecov](https://codecov.io/gh/postgrespro/pg_pathman/branch/master/graph/badge.svg)](https://codecov.io/gh/postgrespro/pg_pathman)
44
[![GitHub license](https://img.shields.io/badge/license-PostgreSQL-blue.svg)](https://raw.githubusercontent.com/postgrespro/pg_pathman/master/LICENSE)
55

66
### NOTE: this project is not under development anymore
77

8-
`pg_pathman` supports Postgres versions [9.5..12], but most probably it won't be ported to 13 and later releases. [Native partitioning](https://www.postgresql.org/docs/current/ddl-partitioning.html) is pretty mature now and has almost everything implemented in `pg_pathman`'; we encourage users switching to it. We are still maintaining the project (fixing bugs in supported versions), but no new development is going to happen here.
8+
`pg_pathman` supports Postgres versions [11..15], but most probably it won't be ported to later releases. [Native partitioning](https://www.postgresql.org/docs/current/ddl-partitioning.html) is pretty mature now and has almost everything implemented in `pg_pathman`'; we encourage users switching to it. We are still maintaining the project (fixing bugs in supported versions), but no new development is going to happen here.
99

1010
# pg_pathman
1111

1212
The `pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.
1313

1414
The extension is compatible with:
1515

16-
* PostgreSQL 9.5, 9.6, 10, 11, 12;
17-
* Postgres Pro Standard 9.5, 9.6, 10, 11, 12;
16+
* PostgreSQL 12, 13;
17+
* PostgreSQL with core-patch: 11, 14, 15;
18+
* Postgres Pro Standard 11, 12, 13, 14, 15;
1819
* Postgres Pro Enterprise;
1920

2021
Take a look at our Wiki [out there](https://github.com/postgrespro/pg_pathman/wiki).
@@ -95,11 +96,19 @@ shared_preload_libraries = 'pg_pathman'
9596
9697
It is essential to restart the PostgreSQL instance. After that, execute the following query in psql:
9798
```plpgsql
98-
CREATE EXTENSION pg_pathman;
99+
CREATE SCHEMA pathman;
100+
GRANT USAGE ON SCHEMA pathman TO PUBLIC;
101+
CREATE EXTENSION pg_pathman WITH SCHEMA pathman;
99102
```
100103

101104
Done! Now it's time to setup your partitioning schemes.
102105

106+
> **Security notice**: pg_pathman is believed to be secure against
107+
search-path-based attacks mentioned in Postgres
108+
[documentation](https://www.postgresql.org/docs/current/sql-createextension.html). However,
109+
if *your* calls of pathman's functions doesn't exactly match the signature, they
110+
might be vulnerable to malicious overloading. If in doubt, install pathman to clean schema where nobody except superusers have CREATE object permission to avoid problems.
111+
103112
> **Windows-specific**: pg_pathman imports several symbols (e.g. None_Receiver, InvalidObjectAddress) from PostgreSQL, which is fine by itself, but requires that those symbols are marked as `PGDLLIMPORT`. Unfortunately, some of them are not exported from vanilla PostgreSQL, which means that you have to either use Postgres Pro Standard/Enterprise (which includes all necessary patches), or patch and build your own distribution of PostgreSQL.
104113
105114
## How to update
@@ -611,7 +620,7 @@ SELECT tableoid::regclass AS partition, * FROM partitioned_table;
611620
- All running concurrent partitioning tasks can be listed using the `pathman_concurrent_part_tasks` view:
612621
```plpgsql
613622
SELECT * FROM pathman_concurrent_part_tasks;
614-
userid | pid | dbid | relid | processed | status
623+
userid | pid | dbid | relid | processed | status
615624
--------+------+-------+-------+-----------+---------
616625
dmitry | 7367 | 16384 | test | 472000 | working
617626
(1 row)
@@ -625,7 +634,7 @@ WHERE parent = 'part_test'::regclass AND range_min::int < 500;
625634
NOTICE: 1 rows copied from part_test_11
626635
NOTICE: 100 rows copied from part_test_1
627636
NOTICE: 100 rows copied from part_test_2
628-
drop_range_partition
637+
drop_range_partition
629638
----------------------
630639
dummy_test_11
631640
dummy_test_1
@@ -780,8 +789,8 @@ All sections and data will remain unchanged and will be handled by the standard
780789
Do not hesitate to post your issues, questions and new ideas at the [issues](https://github.com/postgrespro/pg_pathman/issues) page.
781790

782791
## Authors
783-
[Ildar Musin](https://github.com/zilder)
784-
Alexander Korotkov <a.korotkov(at)postgrespro.ru> Postgres Professional Ltd., Russia
785-
[Dmitry Ivanov](https://github.com/funbringer)
786-
Maksim Milyutin <m.milyutin(at)postgrespro.ru> Postgres Professional Ltd., Russia
792+
[Ildar Musin](https://github.com/zilder)
793+
[Alexander Korotkov](https://github.com/akorotkov)
794+
[Dmitry Ivanov](https://github.com/funbringer)
795+
[Maksim Milyutin](https://github.com/maksm90)
787796
[Ildus Kurbangaliev](https://github.com/ildus)

Diff for: docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
tests:
1+
services:
2+
tests:
23
build: .

Diff for: expected/for_update.out

+20-8
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,49 @@ Parsed test spec with 2 sessions
22

33
starting permutation: s1_b s1_update s2_select s1_r
44
create_range_partitions
5+
-----------------------
6+
10
7+
(1 row)
58

6-
10
79
step s1_b: begin;
810
step s1_update: update test_tbl set id = 2 where id = 1;
911
step s2_select: select * from test_tbl where id = 1;
10-
id val
12+
id|val
13+
--+---
14+
1| 1
15+
(1 row)
1116

12-
1 1
1317
step s1_r: rollback;
1418

1519
starting permutation: s1_b s1_update s2_select_locked s1_r
1620
create_range_partitions
21+
-----------------------
22+
10
23+
(1 row)
1724

18-
10
1925
step s1_b: begin;
2026
step s1_update: update test_tbl set id = 2 where id = 1;
2127
step s2_select_locked: select * from test_tbl where id = 1 for share; <waiting ...>
2228
step s1_r: rollback;
2329
step s2_select_locked: <... completed>
24-
id val
30+
id|val
31+
--+---
32+
1| 1
33+
(1 row)
2534

26-
1 1
2735

2836
starting permutation: s1_b s1_update s2_select_locked s1_c
2937
create_range_partitions
38+
-----------------------
39+
10
40+
(1 row)
3041

31-
10
3242
step s1_b: begin;
3343
step s1_update: update test_tbl set id = 2 where id = 1;
3444
step s2_select_locked: select * from test_tbl where id = 1 for share; <waiting ...>
3545
step s1_c: commit;
3646
step s2_select_locked: <... completed>
37-
id val
47+
id|val
48+
--+---
49+
(0 rows)
3850

0 commit comments

Comments
 (0)