Skip to content

Commit e88832e

Browse files
committed
Merge branch 'PGPROEE9_6' into PGPROEE9_6_MULTIMASTER
2 parents aab2cc0 + 85a8575 commit e88832e

Some content is hidden

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

49 files changed

+3011
-453
lines changed

.ci/build_and_test_world

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
if [ -z "$TCLCONFIG" ]; then
33
[ -x /usr/lib/tcl8.5/tclConfig.sh ] && TCLCONFIG=/usr/lib/tcl8.5
44
[ -x /usr/lib/tcl8.6/tclConfig.sh ] && TCLCONFIG=/usr/lib/tcl8.6
5+
[ -f /usr/lib64/tclConfig.sh ] && TCLCONFIG=/usr/lib64
56
fi
67
[ -n "$TCLCONFIG" ] && export TCLCONFIG
78
echo TCLCONFIG=${TCLCONFIG}

.ci/make_test_base

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@ put into postgresql conf.
77
88
On success, starts database
99
"""
10-
import os,sys,subprocess,glob,re,os.path,time
10+
import os,sys,subprocess,glob,re,os.path,time,re
1111

1212
if len(sys.argv)!=2:
1313
print >>sys.stderr,"Usage %s data-directory" % sys.argv[0]
1414
sys.exit(1)
15+
16+
def prepare_extlist(value):
17+
v = re.sub("[']", '', value)
18+
l = re.split("\s*,\s*",v)
19+
if "pg_pathman" in l:
20+
# remove duplicates and reorder extension list to move pg_pathman to tail
21+
nl = sorted(list(set(l)), cmp = lambda a,b: 1 if a=="pg_pathman" else -1)
22+
new_value = "'{}'".format(",".join(nl))
23+
return new_value
24+
else:
25+
return value
1526

1627
datadir=sys.argv[1]
1728

@@ -56,10 +67,10 @@ for module in glob.glob("contrib/*"):
5667
else:
5768
addopts[opt]=value
5869

59-
if addopts:
70+
if addopts:
6071
with open(datadir+"/postgresql.conf","a") as f:
6172
for opt,value in addopts.items():
62-
print >> f,"%s=%s"%(opt,value)
73+
print >> f,"%s=%s"%(opt,prepare_extlist(value))
6374
with open("initdb.log","a") as f:
6475
exitcode=subprocess.call(["pg_ctl","start","-D",datadir,"-l",datadir+"/postmaster.log"],env=env,stdout=f,stderr=subprocess.STDOUT)
6576
if exitcode:
@@ -73,5 +84,3 @@ while time.time() < failtime:
7384
sys.exit(0)
7485
print >>sys.stderr,"Database havent't started in 60 seconds"
7586
sys.exit(1)
76-
77-

.ci/run

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,25 @@
55

66
set -e
77

8-
./.ci/build_and_test_world
8+
if [ "`id -un`" = "root" ]; then
9+
if [ -d ".ci" ]; then
10+
if [ "`uname`" = "Darwin" ]; then
11+
if ! [ -e /Users/ci ]; then
12+
echo "Error: User ci not found."
13+
exit 1
14+
fi
15+
chown -R ci .
16+
[ -e ~/.ci.env ] && source ~/.ci.env
17+
else
18+
groupadd ci
19+
useradd -g ci ci
20+
chown -R ci:ci .
21+
fi
22+
su ci -c ./.ci/build_and_test_world
23+
else
24+
echo "Error: .ci not found"
25+
exit 1
26+
fi
27+
else
28+
./.ci/build_and_test_world
29+
fi

.ci/run.cmd

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@echo off
2+
PATH=C:\Windows\system32;C:\Perl64\bin;C:\Program Files\Git\cmd;C:\msys64\usr\bin
3+
4+
IF "%ARCH%"=="" SET ARCH=X86
5+
IF "%ARCH%"=="x86" SET ARCH=X86
6+
IF "%ARCH%"=="x64" SET ARCH=X64
7+
IF "%ARCH%"=="amd64" SET ARCH=X64
8+
IF "%SDK%"=="" SET SDK=SDK71
9+
10+
echo BUILD_ID=%BUILD_ID%
11+
echo BUILD_NAME=%BUILD_NAME%
12+
echo ARCH=%ARCH%
13+
echo SDK=%SDK%
14+
15+
IF %SDK% == SDK71 SET DEPENDENCIES_BIN_DIR=C:\pgfarm\deps_%ARCH%_%SDK%
16+
IF %SDK% == MSVC2013 SET DEPENDENCIES_BIN_DIR=C:\pgfarm\deps_%ARCH%
17+
18+
SET PERL32_PATH=C:\Perl
19+
SET PERL64_PATH=C:\Perl64
20+
SET PYTHON32_PATH=C:\Python27x86
21+
SET PYTHON64_PATH=C:\Python27x64
22+
23+
IF %SDK% == SDK71 (
24+
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv" /%ARCH% || GOTO :ERROR
25+
ECHO ON
26+
)
27+
28+
IF %SDK% == MSVC2013 (
29+
IF %ARCH% == X86 CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall" x86 || GOTO :ERROR
30+
ECHO ON
31+
IF %ARCH% == X64 CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall" amd64 || GOTO :ERROR
32+
ECHO ON
33+
)
34+
35+
>src\tools\msvc\config.pl ECHO use strict;
36+
>>src\tools\msvc\config.pl ECHO use warnings;
37+
>>src\tools\msvc\config.pl ECHO our $config = {
38+
>>src\tools\msvc\config.pl ECHO asserts ^=^> 0^, ^# --enable-cassert
39+
>>src\tools\msvc\config.pl ECHO ^# integer_datetimes^=^>1,
40+
>>src\tools\msvc\config.pl ECHO ^# float4byval^=^>1,
41+
>>src\tools\msvc\config.pl ECHO ^# float8byval^=^>0,
42+
>>src\tools\msvc\config.pl ECHO ^# blocksize ^=^> 8,
43+
>>src\tools\msvc\config.pl ECHO ^# wal_blocksize ^=^> 8,
44+
>>src\tools\msvc\config.pl ECHO ^# wal_segsize ^=^> 16,
45+
>>src\tools\msvc\config.pl ECHO ldap ^=^> 1,
46+
>>src\tools\msvc\config.pl ECHO nls ^=^> '%DEPENDENCIES_BIN_DIR%\libintl',
47+
>>src\tools\msvc\config.pl ECHO tcl ^=^> undef,
48+
IF %ARCH% == X64 (>>src\tools\msvc\config.pl ECHO perl ^=^> '%PERL64_PATH%', )
49+
IF %ARCH% == X86 (>>src\tools\msvc\config.pl ECHO perl ^=^> '%PERL32_PATH%', )
50+
IF %ARCH% == X64 (>>src\tools\msvc\config.pl ECHO python ^=^> '%PYTHON64_PATH%', )
51+
IF %ARCH% == X86 (>>src\tools\msvc\config.pl ECHO python ^=^> '%PYTHON32_PATH%', )
52+
>>src\tools\msvc\config.pl ECHO openssl ^=^> '%DEPENDENCIES_BIN_DIR%\openssl',
53+
>>src\tools\msvc\config.pl ECHO uuid ^=^> '%DEPENDENCIES_BIN_DIR%\uuid',
54+
>>src\tools\msvc\config.pl ECHO xml ^=^> '%DEPENDENCIES_BIN_DIR%\libxml2',
55+
>>src\tools\msvc\config.pl ECHO xslt ^=^> '%DEPENDENCIES_BIN_DIR%\libxslt',
56+
>>src\tools\msvc\config.pl ECHO iconv ^=^> '%DEPENDENCIES_BIN_DIR%\iconv',
57+
>>src\tools\msvc\config.pl ECHO zlib ^=^> '%DEPENDENCIES_BIN_DIR%\zlib',
58+
>>src\tools\msvc\config.pl ECHO icu ^=^> '%DEPENDENCIES_BIN_DIR%\icu'
59+
>>src\tools\msvc\config.pl ECHO ^};
60+
>>src\tools\msvc\config.pl ECHO 1^;
61+
62+
type .\src\tools\msvc\config.pl
63+
64+
perl src\tools\msvc\build.pl || GOTO :ERROR
65+
66+
GOTO :DONE
67+
:ERROR
68+
ECHO Failed with error #%errorlevel%.
69+
EXIT /b %errorlevel%
70+
:DONE
71+
ECHO Done.

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ else
27702770
fi
27712771

27722772

2773-
PGPRO_VERSION="$PACKAGE_VERSION.2"
2773+
PGPRO_VERSION="$PACKAGE_VERSION.1"
27742774
PGPRO_PACKAGE_NAME="PostgresPro"
27752775
PGPRO_EDITION="enterprise"
27762776

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major versio
3838
PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
3939
[PG_VERSION="$PACKAGE_VERSION$withval"],
4040
[PG_VERSION="$PACKAGE_VERSION"])
41-
PGPRO_VERSION="$PACKAGE_VERSION.2"
41+
PGPRO_VERSION="$PACKAGE_VERSION.1"
4242
PGPRO_PACKAGE_NAME="PostgresPro"
4343
PGPRO_EDITION="enterprise"
4444
AC_SUBST(PGPRO_PACKAGE_NAME)

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.2",
5+
"version": "1.4.3",
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.2",
27+
"version": "1.4.3",
2828
"abstract": "Partitioning tool"
2929
}
3030
},

contrib/pg_pathman/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ REGRESS = pathman_array_qual \
4747
pathman_rowmarks \
4848
pathman_runtime_nodes \
4949
pathman_update_trigger \
50+
pathman_upd_del \
5051
pathman_utility_stmt
5152

5253
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add

contrib/pg_pathman/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Update RANGE partitioned table interval. Note that interval must not be negative
263263
```plpgsql
264264
set_enable_parent(relation REGCLASS, value BOOLEAN)
265265
```
266-
Include/exclude parent table into/from query plan. In original PostgreSQL planner parent table is always included into query plan even if it's empty which can lead to additional overhead. You can use `disable_parent()` if you are never going to use parent table as a storage. Default value depends on the `partition_data` parameter that was specified during initial partitioning in `create_range_partitions()` or `create_partitions_from_range()` functions. If the `partition_data` parameter was `true` then all data have already been migrated to partitions and parent table disabled. Otherwise it is enabled.
266+
Include/exclude parent table into/from query plan. In original PostgreSQL planner parent table is always included into query plan even if it's empty which can lead to additional overhead. You can use `disable_parent()` if you are never going to use parent table as a storage. Default value depends on the `partition_data` parameter that was specified during initial partitioning in `create_range_partitions()` function. If the `partition_data` parameter was `true` then all data have already been migrated to partitions and parent table disabled. Otherwise it is enabled.
267267

268268
```plpgsql
269269
set_auto(relation REGCLASS, value BOOLEAN)

contrib/pg_pathman/expected/pathman_basic.out

Lines changed: 3 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,100 +1653,13 @@ EXPLAIN (COSTS OFF) SELECT * FROM test.range_rel WHERE dt > '2010-12-15';
16531653
-> Seq Scan on range_rel_14
16541654
(4 rows)
16551655

1656-
/* Temporary table for JOINs */
1657-
CREATE TABLE test.tmp (id INTEGER NOT NULL, value INTEGER NOT NULL);
1658-
INSERT INTO test.tmp VALUES (1, 1), (2, 2);
1659-
/* Test UPDATE and DELETE */
1660-
EXPLAIN (COSTS OFF) UPDATE test.range_rel SET value = 111 WHERE dt = '2010-06-15'; /* have partitions for this 'dt' */
1661-
QUERY PLAN
1662-
--------------------------------------------------------------------------------
1663-
Update on range_rel_6
1664-
-> Seq Scan on range_rel_6
1665-
Filter: (dt = 'Tue Jun 15 00:00:00 2010'::timestamp without time zone)
1666-
(3 rows)
1667-
1668-
UPDATE test.range_rel SET value = 111 WHERE dt = '2010-06-15';
1669-
SELECT * FROM test.range_rel WHERE dt = '2010-06-15';
1670-
id | dt | value
1671-
-----+--------------------------+-------
1672-
166 | Tue Jun 15 00:00:00 2010 | 111
1673-
(1 row)
1674-
1675-
EXPLAIN (COSTS OFF) DELETE FROM test.range_rel WHERE dt = '2010-06-15'; /* have partitions for this 'dt' */
1676-
QUERY PLAN
1677-
--------------------------------------------------------------------------------
1678-
Delete on range_rel_6
1679-
-> Seq Scan on range_rel_6
1680-
Filter: (dt = 'Tue Jun 15 00:00:00 2010'::timestamp without time zone)
1681-
(3 rows)
1682-
1683-
DELETE FROM test.range_rel WHERE dt = '2010-06-15';
1684-
SELECT * FROM test.range_rel WHERE dt = '2010-06-15';
1685-
id | dt | value
1686-
----+----+-------
1687-
(0 rows)
1688-
1689-
EXPLAIN (COSTS OFF) UPDATE test.range_rel SET value = 222 WHERE dt = '1990-01-01'; /* no partitions for this 'dt' */
1690-
QUERY PLAN
1691-
--------------------------------------------------------------------------------
1692-
Update on range_rel
1693-
-> Seq Scan on range_rel
1694-
Filter: (dt = 'Mon Jan 01 00:00:00 1990'::timestamp without time zone)
1695-
(3 rows)
1696-
1697-
UPDATE test.range_rel SET value = 111 WHERE dt = '1990-01-01';
1698-
SELECT * FROM test.range_rel WHERE dt = '1990-01-01';
1699-
id | dt | value
1700-
----+----+-------
1701-
(0 rows)
1702-
1703-
EXPLAIN (COSTS OFF) DELETE FROM test.range_rel WHERE dt < '1990-01-01'; /* no partitions for this 'dt' */
1704-
QUERY PLAN
1705-
--------------------------------------------------------------------------------
1706-
Delete on range_rel
1707-
-> Seq Scan on range_rel
1708-
Filter: (dt < 'Mon Jan 01 00:00:00 1990'::timestamp without time zone)
1709-
(3 rows)
1710-
1711-
DELETE FROM test.range_rel WHERE dt < '1990-01-01';
1712-
SELECT * FROM test.range_rel WHERE dt < '1990-01-01';
1713-
id | dt | value
1714-
----+----+-------
1715-
(0 rows)
1716-
1717-
EXPLAIN (COSTS OFF) UPDATE test.range_rel r SET value = t.value FROM test.tmp t WHERE r.dt = '2010-01-01' AND r.id = t.id;
1718-
QUERY PLAN
1719-
--------------------------------------------------------------------------------------------
1720-
Update on range_rel_1 r
1721-
-> Hash Join
1722-
Hash Cond: (t.id = r.id)
1723-
-> Seq Scan on tmp t
1724-
-> Hash
1725-
-> Index Scan using range_rel_1_pkey on range_rel_1 r
1726-
Filter: (dt = 'Fri Jan 01 00:00:00 2010'::timestamp without time zone)
1727-
(7 rows)
1728-
1729-
UPDATE test.range_rel r SET value = t.value FROM test.tmp t WHERE r.dt = '2010-01-01' AND r.id = t.id;
1730-
EXPLAIN (COSTS OFF) DELETE FROM test.range_rel r USING test.tmp t WHERE r.dt = '2010-01-02' AND r.id = t.id;
1731-
QUERY PLAN
1732-
--------------------------------------------------------------------------------------------
1733-
Delete on range_rel_1 r
1734-
-> Hash Join
1735-
Hash Cond: (t.id = r.id)
1736-
-> Seq Scan on tmp t
1737-
-> Hash
1738-
-> Index Scan using range_rel_1_pkey on range_rel_1 r
1739-
Filter: (dt = 'Sat Jan 02 00:00:00 2010'::timestamp without time zone)
1740-
(7 rows)
1741-
1742-
DELETE FROM test.range_rel r USING test.tmp t WHERE r.dt = '2010-01-02' AND r.id = t.id;
17431656
/* Create range partitions from whole range */
17441657
SELECT drop_partitions('test.range_rel');
1745-
NOTICE: 44 rows copied from test.range_rel_1
1658+
NOTICE: 45 rows copied from test.range_rel_1
17461659
NOTICE: 31 rows copied from test.range_rel_3
17471660
NOTICE: 30 rows copied from test.range_rel_4
17481661
NOTICE: 31 rows copied from test.range_rel_5
1749-
NOTICE: 29 rows copied from test.range_rel_6
1662+
NOTICE: 30 rows copied from test.range_rel_6
17501663
NOTICE: 31 rows copied from test.range_rel_7
17511664
NOTICE: 31 rows copied from test.range_rel_8
17521665
NOTICE: 30 rows copied from test.range_rel_9
@@ -1939,6 +1852,6 @@ ORDER BY partition;
19391852
DROP TABLE test.provided_part_names CASCADE;
19401853
NOTICE: drop cascades to 2 other objects
19411854
DROP SCHEMA test CASCADE;
1942-
NOTICE: drop cascades to 29 other objects
1855+
NOTICE: drop cascades to 28 other objects
19431856
DROP EXTENSION pg_pathman CASCADE;
19441857
DROP SCHEMA pathman CASCADE;

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-
10402
15+
10403
1616
(1 row)
1717

1818
set client_min_messages = NOTICE;

0 commit comments

Comments
 (0)