Skip to content

Commit cdf45c3

Browse files
committed
Merge branch 'PGPROEE9_6' into PGPROEE9_6_ALPHA
2 parents 7870fee + df6e2f8 commit cdf45c3

File tree

283 files changed

+68350
-6661
lines changed

Some content is hidden

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

283 files changed

+68350
-6661
lines changed

.gitlab-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
image: debian
2+
3+
stages:
4+
- build
5+
- test
6+
7+
before_script:
8+
- export DEBIAN_FRONTEND=noninteractive
9+
- export CORES=$(grep -c ^processor /proc/cpuinfo)
10+
- uname -a
11+
- df -h
12+
13+
build:ubuntu-16.04:
14+
stage: build
15+
image: ubuntu:16.04
16+
only:
17+
- PGPROEE9_6
18+
before_script:
19+
- apt-get update && apt-get install -y gcc make flex bison libreadline-dev zlib1g-dev jade libzstd0 libzstd-dev
20+
script:
21+
- ./configure
22+
- make -j $CORES
23+
- apt-get install sudo
24+
- sudo make install
25+
when: always
26+
27+
test:
28+
stage: test
29+
image: ubuntu:16.04
30+
only:
31+
- PGPROEE9_6
32+
before_script:
33+
- apt-get update && apt-get install -y gcc make flex bison libreadline-dev zlib1g-dev jade libzstd0 libzstd-dev
34+
script:
35+
- ./configure
36+
- make -j $CORES
37+
- apt-get install sudo
38+
- adduser --disabled-password --gecos '' postgres
39+
- echo '%postgres ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
40+
- su -m postgres -c make check
41+
when: always

configure

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6.0.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 9.6.1.
44
#
55
# Report bugs to <bugs@postgrespro.ru>.
66
#
@@ -583,8 +583,8 @@ MAKEFLAGS=
583583
# Identity of this package.
584584
PACKAGE_NAME='PostgreSQL'
585585
PACKAGE_TARNAME='postgrespro'
586-
PACKAGE_VERSION='9.6.0'
587-
PACKAGE_STRING='PostgreSQL 9.6.0'
586+
PACKAGE_VERSION='9.6.1'
587+
PACKAGE_STRING='PostgreSQL 9.6.1'
588588
PACKAGE_BUGREPORT='bugs@postgrespro.ru'
589589
PACKAGE_URL=''
590590

@@ -756,6 +756,7 @@ build_os
756756
build_vendor
757757
build_cpu
758758
build
759+
PGPRO_EDITION
759760
PGPRO_PACKAGE_NAME
760761
PG_MAJORVERSION
761762
configure_args
@@ -1403,7 +1404,7 @@ if test "$ac_init_help" = "long"; then
14031404
# Omit some internal or obsolete options to make the list less imposing.
14041405
# This message is too long to be a string in the A/UX 3.1 sh.
14051406
cat <<_ACEOF
1406-
\`configure' configures PostgreSQL 9.6.0 to adapt to many kinds of systems.
1407+
\`configure' configures PostgreSQL 9.6.1 to adapt to many kinds of systems.
14071408

14081409
Usage: $0 [OPTION]... [VAR=VALUE]...
14091410

@@ -1468,7 +1469,7 @@ fi
14681469

14691470
if test -n "$ac_init_help"; then
14701471
case $ac_init_help in
1471-
short | recursive ) echo "Configuration of PostgreSQL 9.6.0:";;
1472+
short | recursive ) echo "Configuration of PostgreSQL 9.6.1:";;
14721473
esac
14731474
cat <<\_ACEOF
14741475

@@ -1621,7 +1622,7 @@ fi
16211622
test -n "$ac_init_help" && exit $ac_status
16221623
if $ac_init_version; then
16231624
cat <<\_ACEOF
1624-
PostgreSQL configure 9.6.0
1625+
PostgreSQL configure 9.6.1
16251626
generated by GNU Autoconf 2.69
16261627

16271628
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2333,7 +2334,7 @@ cat >config.log <<_ACEOF
23332334
This file contains any messages produced by compilers while
23342335
running configure, to aid debugging if configure makes a mistake.
23352336

2336-
It was created by PostgreSQL $as_me 9.6.0, which was
2337+
It was created by PostgreSQL $as_me 9.6.1, which was
23372338
generated by GNU Autoconf 2.69. Invocation command line was
23382339

23392340
$ $0 $@
@@ -2752,6 +2753,8 @@ fi
27522753

27532754
PGPRO_VERSION="$PACKAGE_VERSION.1"
27542755
PGPRO_PACKAGE_NAME="PostgresPro"
2756+
PGPRO_EDITION="enterprise"
2757+
27552758

27562759

27572760
cat >>confdefs.h <<_ACEOF
@@ -2764,6 +2767,11 @@ cat >>confdefs.h <<_ACEOF
27642767
_ACEOF
27652768

27662769

2770+
cat >>confdefs.h <<_ACEOF
2771+
#define PGPRO_EDITION "$PGPRO_EDITION"
2772+
_ACEOF
2773+
2774+
27672775
cat >>confdefs.h <<_ACEOF
27682776
#define PGPRO_VERSION "$PGPRO_VERSION"
27692777
_ACEOF
@@ -18358,7 +18366,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1835818366
# report actual input values of CONFIG_FILES etc. instead of their
1835918367
# values after options handling.
1836018368
ac_log="
18361-
This file was extended by PostgreSQL $as_me 9.6.0, which was
18369+
This file was extended by PostgreSQL $as_me 9.6.1, which was
1836218370
generated by GNU Autoconf 2.69. Invocation command line was
1836318371

1836418372
CONFIG_FILES = $CONFIG_FILES
@@ -18428,7 +18436,7 @@ _ACEOF
1842818436
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1842918437
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1843018438
ac_cs_version="\\
18431-
PostgreSQL config.status 9.6.0
18439+
PostgreSQL config.status 9.6.1
1843218440
configured by $0, generated by GNU Autoconf 2.69,
1843318441
with options \\"\$ac_cs_config\\"
1843418442

configure.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dnl Read the Autoconf manual for details.
1717
dnl
1818
m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
1919

20-
AC_INIT([PostgreSQL], [9.6.0], [bugs@postgrespro.ru],[postgrespro])
20+
AC_INIT([PostgreSQL], [9.6.1], [bugs@postgrespro.ru],[postgrespro])
2121
PACKAGE_TARNAME=postgrespro
2222

2323
m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
@@ -40,9 +40,12 @@ PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
4040
[PG_VERSION="$PACKAGE_VERSION"])
4141
PGPRO_VERSION="$PACKAGE_VERSION.1"
4242
PGPRO_PACKAGE_NAME="PostgresPro"
43+
PGPRO_EDITION="enterprise"
4344
AC_SUBST(PGPRO_PACKAGE_NAME)
45+
AC_SUBST(PGPRO_EDITION)
4446
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])
4547
AC_DEFINE_UNQUOTED(PGPRO_PACKAGE_NAME, "$PGPRO_PACKAGE_NAME", [PostgresPro name as a string])
48+
AC_DEFINE_UNQUOTED(PGPRO_EDITION,"$PGPRO_EDITION",[PostgresPro edition])
4649
AC_DEFINE_UNQUOTED(PGPRO_VERSION, "$PGPRO_VERSION", [PostgresPro version as a string])
4750

4851
AC_CANONICAL_HOST

contrib/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ SUBDIRS = \
6262
sr_plan \
6363
pg_arman \
6464
pg_pathman \
65-
shared_ispell
65+
shared_ispell \
66+
pg_hint_plan
6667

6768
ifeq ($(with_openssl),yes)
6869
SUBDIRS += sslinfo

contrib/oid2name/oid2name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ help(const char *progname)
188188
" -x extended (show additional columns)\n"
189189
" -?, --help show this help, then exit\n"
190190
"\nThe default action is to show all database OIDs.\n\n"
191-
"Report bugs to <pgsql-bugs@postgresql.org>.\n",
191+
"Report bugs to <" PACKAGE_BUGREPORT ">.\n",
192192
progname, progname);
193193
}
194194

contrib/pg_buffercache/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ MODULE_big = pg_buffercache
44
OBJS = pg_buffercache_pages.o $(WIN32RES)
55

66
EXTENSION = pg_buffercache
7-
DATA = pg_buffercache--1.2.sql pg_buffercache--1.1--1.2.sql \
8-
pg_buffercache--1.0--1.1.sql pg_buffercache--unpackaged--1.0.sql
7+
DATA = pg_buffercache--1.3.sql pg_buffercache--1.2--1.3.sql \
8+
pg_buffercache--1.1--1.2.sql pg_buffercache--1.0--1.1.sql \
9+
pg_buffercache--unpackaged--1.0.sql
910
PGFILEDESC = "pg_buffercache - monitoring of shared buffer cache in real-time"
1011

1112
ifdef USE_PGXS
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* contrib/pg_buffercache/pg_buffercache--1.2--1.3.sql */
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use "ALTER EXTENSION pg_buffercache(text) UPDATE TO '1.3'" to load this file. \quit
5+
6+
ALTER FUNCTION pg_buffercache_pages() PARALLEL SAFE;

contrib/pg_buffercache/pg_buffercache--1.2.sql renamed to contrib/pg_buffercache/pg_buffercache--1.3.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/pg_buffercache/pg_buffercache--1.2.sql */
1+
/* contrib/pg_buffercache/pg_buffercache--1.3.sql */
22

33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use "CREATE EXTENSION pg_buffercache" to load this file. \quit
@@ -18,4 +18,4 @@ CREATE VIEW pg_buffercache AS
1818

1919
-- Don't want these to be available to public.
2020
REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
21-
REVOKE ALL ON pg_buffercache FROM PUBLIC;
21+
REVOKE ALL ON pg_buffercache FROM PUBLIC;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_buffercache extension
22
comment = 'examine the shared buffer cache'
3-
default_version = '1.2'
3+
default_version = '1.3'
44
module_pathname = '$libdir/pg_buffercache'
55
relocatable = true

contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
135135
/* Return to original context when allocating transient memory */
136136
MemoryContextSwitchTo(oldcontext);
137137

138-
/*
139-
* To get a consistent picture of the buffer state, we must lock all
140-
* partitions of the buffer map. Needless to say, this is horrible
141-
* for concurrency. Must grab locks in increasing order to avoid
142-
* possible deadlocks.
143-
*/
144-
for (i = 0; i < NUM_BUFFER_PARTITIONS; i++)
145-
LWLockAcquire(BufMappingPartitionLockByIndex(i), LW_SHARED);
146-
147138
/*
148139
* Scan through all the buffers, saving the relevant fields in the
149140
* fctx->record structure.
@@ -154,6 +145,12 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
154145
uint32 buf_state;
155146

156147
bufHdr = GetBufferDescriptor(i);
148+
if (bufHdr->tag.forkNum == -1)
149+
{
150+
fctx->record[i].blocknum = InvalidBlockNumber;
151+
continue;
152+
}
153+
157154
/* Lock each buffer header before inspecting. */
158155
buf_state = LockBufHdr(bufHdr);
159156

@@ -179,16 +176,6 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
179176

180177
UnlockBufHdr(bufHdr, buf_state);
181178
}
182-
183-
/*
184-
* And release locks. We do this in reverse order for two reasons:
185-
* (1) Anyone else who needs more than one of the locks will be trying
186-
* to lock them in increasing order; we don't want to release the
187-
* other process until it can get all the locks it needs. (2) This
188-
* avoids O(N^2) behavior inside LWLockRelease.
189-
*/
190-
for (i = NUM_BUFFER_PARTITIONS; --i >= 0;)
191-
LWLockRelease(BufMappingPartitionLockByIndex(i));
192179
}
193180

194181
funcctx = SRF_PERCALL_SETUP();

contrib/pg_hint_plan/COPYRIGHT

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2012-2016, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of the NIPPON TELEGRAPH AND TELEPHONE CORPORATION
13+
(NTT) nor the names of its contributors may be used to endorse or
14+
promote products derived from this software without specific prior
15+
written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
core.c and make_join_rel.c are parts of PostgreSQL Database Management System.
2+
(formerly known as Postgres, then as Postgres95)
3+
Copyright holders of those files are following organizations:
4+
5+
Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
6+
7+
Portions Copyright (c) 1994, The Regents of the University of California
8+
9+
Permission to use, copy, modify, and distribute this software and its
10+
documentation for any purpose, without fee, and without a written agreement
11+
is hereby granted, provided that the above copyright notice and this
12+
paragraph and the following two paragraphs appear in all copies.
13+
14+
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
15+
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
16+
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
17+
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
18+
POSSIBILITY OF SUCH DAMAGE.
19+
20+
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22+
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23+
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
24+
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

contrib/pg_hint_plan/Makefile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# pg_hint_plan: Makefile
3+
#
4+
# Copyright (c) 2012-2016, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
5+
#
6+
7+
MODULES = pg_hint_plan
8+
HINTPLANVER = 1.1.3
9+
10+
REGRESS = init base_plan pg_hint_plan ut-init ut-A ut-S ut-J ut-L ut-G ut-R ut-fdw ut-fini
11+
12+
REGRESSION_EXPECTED = expected/init.out expected/base_plan.out expected/pg_hint_plan.out expected/ut-A.out expected/ut-S.out expected/ut-J.out expected/ut-L.out expected/ut-G.out
13+
14+
REGRESS_OPTS = --encoding=UTF8
15+
16+
EXTENSION = pg_hint_plan
17+
DATA = pg_hint_plan--1.1.3.sql
18+
19+
EXTRA_CLEAN = sql/ut-fdw.sql expected/ut-fdw.out
20+
21+
ifdef USE_PGXS
22+
PG_CONFIG = pg_config
23+
PGXS := $(shell $(PG_CONFIG) --pgxs)
24+
include $(PGXS)
25+
else
26+
subdir = contrib/pg_hint_plan
27+
top_builddir = ../..
28+
include $(top_builddir)/src/Makefile.global
29+
include $(top_srcdir)/contrib/contrib-global.mk
30+
override CFLAGS += -I$(top_builddir)/src/pl/plpgsql/src
31+
REGRESS = init base_plan pg_hint_plan
32+
endif
33+
34+
STARBALL96 = pg_hint_plan96-$(HINTPLANVER).tar.gz
35+
STARBALLS = $(STARBALL96)
36+
37+
TARSOURCES = Makefile *.c *.h COPYRIGHT* \
38+
pg_hint_plan--*.sql \
39+
pg_hint_plan.control \
40+
doc/* expected/*.out sql/*.sql sql/maskout.sh \
41+
data/data.csv input/*.source output/*.source SPECS/*.spec
42+
43+
installcheck: $(REGRESSION_EXPECTED)
44+
45+
rpms: rpm96
46+
47+
# pg_hint_plan.c includes core.c and make_join_rel.c
48+
pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
49+
50+
$(STARBALLS): $(TARSOURCES)
51+
if [ -h $(subst .tar.gz,,$@) ]; then rm $(subst .tar.gz,,$@); fi
52+
if [ -e $(subst .tar.gz,,$@) ]; then \
53+
echo "$(subst .tar.gz,,$@) is not a symlink. Stop."; \
54+
exit 1; \
55+
fi
56+
ln -s . $(subst .tar.gz,,$@)
57+
tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
58+
rm $(subst .tar.gz,,$@)
59+
60+
rpm96: $(STARBALL96)
61+
MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan96.spec
62+
63+

0 commit comments

Comments
 (0)