Skip to content

Commit

Permalink
Merge with PostgreSQL 9.1beta2.
Browse files Browse the repository at this point in the history
This is the final batch of commits from PostgreSQL 9.1 development, up
to the point where the REL9_1_STABLE branch was created, and 9.2
development started on the PostgreSQL master branch.

Notable upstream changes:

* Changes to "temporary" vs. "permanent" relation handling. Previously,
  relations were classified as either temporary or not-temporary. Now
  there is a concept of "relation persistence", which includes
  un-WAL-logged (but permanent) tables as a third option.

  Additionally, 9.1 adds the backend ID to the relpath of temporary
  tables. Because GPDB does not have a 1:1 relationship between backends
  and temp relations, this has been reverted for now and the concept of
  a special `TempRelBackendId` has been added. We may look into
  backporting pieces of the parallel session support from future
  versions of PostgreSQL to minimize this difference.

  There is currently a fatal flaw in our handling of relfilenodes for
  temporary relations: it is possible (though unlikely) for a temporary
  sequence and a permanent relation (or vice-versa) to point to the same
  shared buffer in the buffer cache. This may lead to corruption of that
  buffer. Our current attempt at a fix for this issue isn't good enough
  yet, so the offending code is marked with FIXMEs. We plan to solve this
  problem with a total overhaul of the way temporary relations are
  stored in the shared buffer cache.

* Collation is now supported per-column. Many plan nodes now have their
  own concept of input and output collation IDs. Notably, since this
  change involves heavy changes to generated plans, ORCA does not yet
  support non-default collation.

* The SERIALIZABLE isolation level was added. This is not currently
  supported in GPDB, because we don't have a way to analyze
  serialization conflicts in a distributed manner; we will "fall back"
  to REPEATABLE READ.

* GROUP BY now allows selection of columns in the grouping query without
  mentioning those columns in the GROUP BY clause, as long as those
  columns are from a table that's being grouped by its primary key. This
  requires some modification to the parallel grouping planner in GPDB.

* Support for INSTEAD OF triggers on views. Notably, this would allow
  "modification" of views, but GPDB currently has no support for this
  concept in the planner. This functionality is temporarily disabled for
  now.

* CTEs (WITH ... AS) can now contain data modification statements
  (INSERT/UPDATE/DELETE). This is not yet supported in GPDB.

* `make -k` is now supported for installcheck[-world] and several other
  Makefile targets.

* Foreign tables. Currently, GPDB does not support planning for
  statements made against foreign tables, so CREATE FOREIGN TABLE has
  been disabled.

* SELinux support and integration has been added with the SECURITY LABEL
  command and the associated sepgsql utility. SECURITY LABEL support is
  currently tested in GPDB via the upstream regression tests, but
  sepgsql is not.

* GUC API changes: assignment hooks are now split into two phases
  (check/assign).

Notable GPDB changes:

* Several pieces of the COPY dispatching code have been heavily
  refactored/rewritten to match upstream more closely. For now,
  compatibility with 5.x external table catalog entries has been
  maintained, though this is likely to change.

Co-authored-by: Asim Praveen <apraveen@pivotal.io>
Co-authored-by: Bhuvnesh Chaudhary <bchaudhary@pivotal.io>
Co-authored-by: Dhanashree Kashid <dkashid@pivotal.io>
Co-authored-by: Goutam Tadi <gtadi@pivotal.io>
Co-authored-by: Heikki Linnakangas <hlinnakangas@pivotal.io>
Co-authored-by: Jacob Champion <pchampion@pivotal.io>
Co-authored-by: Jesse Zhang <sbjesse@gmail.com>
Co-authored-by: Jinbao Chen <jinchen@pivotal.io>
Co-authored-by: Larry Hamel <lhamel@pivotal.io>
Co-authored-by: Max Yang <myang@pivotal.io>
Co-authored-by: Melanie Plageman <mplageman@pivotal.io>
Co-authored-by: Omer Arap <oarap@pivotal.io>
Co-authored-by: Paul Guo <paulguo@gmail.com>
Co-authored-by: Richard Guo <guofenglinux@gmail.com>
Co-authored-by: Sambitesh Dash <sdash@pivotal.io>
Co-authored-by: Shreedhar Hardikar <shardikar@pivotal.io>
Co-authored-by: Taylor Vesely <tvesely@pivotal.io>
Co-authored-by: Venkatesh Raghavan <vraghavan@pivotal.io>
  • Loading branch information
18 people committed May 18, 2018
2 parents 7f9f11d + a4bebdd commit 25a9039
Show file tree
Hide file tree
Showing 2,950 changed files with 206,395 additions and 64,293 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Expand Up @@ -14,7 +14,6 @@
objfiles.txt
.deps/
*.log
*.vcproj
*.gcno
*.gcda
*.gcov
Expand Down Expand Up @@ -48,10 +47,15 @@ build.sh
GPATH
GRTAGS
GTAGS
lib*dll.def

# Local excludes in root directory
/GNUmakefile
/config.log
/config.status
/VERSION
/pgsql.sln
/pgsql.sln.cache
/Debug/
/Release/
/CMakeLists.txt
154 changes: 60 additions & 94 deletions GNUmakefile.in
@@ -1,18 +1,18 @@
#
# PostgreSQL top level makefile
#
# $PostgreSQL: pgsql/GNUmakefile.in,v 1.58 2010/03/30 00:10:46 petere Exp $
# GNUmakefile.in
#

subdir =
top_builddir = .
include $(top_builddir)/src/Makefile.global

$(call recurse,all install,src config)

all:
$(MAKE) -C src all
$(MAKE) -C config all
$(MAKE) -C contrib/xlogdump all
$(MAKE) -C contrib/file_fdw all
$(MAKE) -C contrib/formatter all
$(MAKE) -C contrib/formatter_fixedwidth all
$(MAKE) -C contrib/fuzzystrmatch all
Expand All @@ -31,25 +31,21 @@ all:
$(MAKE) -C gpAux/extensions all
$(MAKE) -C gpAux/gpperfmon all
$(MAKE) -C gpAux/platform all
@echo "All of Greenplum Database successfully made. Ready to install."
+@echo "All of Greenplum Database successfully made. Ready to install."

docs:
$(MAKE) -C doc all

$(call recurse,world,doc src config contrib,all)
world:
$(MAKE) -C doc all
$(MAKE) -C src all
$(MAKE) -C config all
$(MAKE) -C contrib all
@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install."
+@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install."

html man:
$(MAKE) -C doc $@

install:
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib/xlogdump $@
#$(MAKE) -C contrib/file_fdw $@ # GPDB_91_MERGE_FIXME: disable installation until it's officially supported.
$(MAKE) -C contrib/formatter $@
$(MAKE) -C contrib/formatter_fixedwidth $@
$(MAKE) -C contrib/fuzzystrmatch $@
Expand All @@ -69,77 +65,32 @@ install:
$(MAKE) -C gpAux/extensions $@
$(MAKE) -C gpAux/gpperfmon $@
$(MAKE) -C gpAux/platform $@
@echo "Greenplum Database installation complete."
+@echo "Greenplum Database installation complete."

install-docs:
$(MAKE) -C doc install

$(call recurse,install-world,doc src config contrib,install)
install-world:
$(MAKE) -C doc install
$(MAKE) -C src install
$(MAKE) -C config install
$(MAKE) -C contrib install
@echo "PostgreSQL, contrib, and documentation installation complete."
+@echo "PostgreSQL, contrib, and documentation installation complete."

installdirs uninstall coverage:
# $(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib/xlogdump $@
$(MAKE) -C contrib/formatter $@
$(MAKE) -C contrib/formatter_fixedwidth $@
$(MAKE) -C contrib/fuzzystrmatch $@
$(MAKE) -C contrib/extprotocol $@
$(MAKE) -C contrib/dblink $@
$(MAKE) -C contrib/gp_sparse_vector $@
$(MAKE) -C contrib/gp_distribution_policy $@
$(MAKE) -C contrib/gp_inject_fault $@
$(MAKE) -C contrib/gp_internal_tools $@
$(MAKE) -C contrib/gp_cancel_query $@
$(MAKE) -C contrib/indexscan $@
$(MAKE) -C contrib/pg_upgrade_support $@
$(MAKE) -C contrib/pg_upgrade $@
$(MAKE) -C contrib/hstore $@
$(MAKE) -C contrib/pgcrypto $@
$(call recurse,installdirs uninstall coverage,doc src config)

distprep:
# $(MAKE) -C doc $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib $@
$(call recurse,distprep,doc src config contrib)

# clean, distclean, etc should apply to contrib too, even though
# it's not built by default
$(call recurse,clean,doc contrib src config)
clean:
# $(MAKE) -C doc $@
$(MAKE) -C contrib $@
$(MAKE) -C src $@
$(MAKE) -C config $@
$(MAKE) -C contrib/xlogdump $@
$(MAKE) -C contrib/formatter $@
$(MAKE) -C contrib/formatter_fixedwidth $@
$(MAKE) -C contrib/fuzzystrmatch $@
$(MAKE) -C contrib/extprotocol $@
$(MAKE) -C contrib/dblink $@
$(MAKE) -C contrib/gp_sparse_vector $@
$(MAKE) -C contrib/gp_distribution_policy $@
$(MAKE) -C contrib/gp_inject_fault $@
$(MAKE) -C contrib/gp_internal_tools $@
$(MAKE) -C contrib/gp_cancel_query $@
$(MAKE) -C contrib/indexscan $@
$(MAKE) -C contrib/pg_upgrade_support $@
$(MAKE) -C contrib/pg_upgrade $@
$(MAKE) -C contrib/hstore $@
$(MAKE) -C contrib/pgcrypto $@
# Garbage from autoconf:
@rm -rf autom4te.cache/
# leap over gpAux/Makefile into subdirectories to avoid circular dependency.
# gpAux/Makefile is the entry point for the enterprise build, which ends up
# calling top-level configure and this Makefile
$(MAKE) -C gpAux/extensions $@
$(MAKE) -C gpAux/gpperfmon $@
$(MAKE) -C gpAux/platform $@
$(MAKE) -C gpMgmt $@
# Garbage from autoconf:
@rm -rf autom4te.cache/

# Important: distclean `src' last, otherwise Makefile.global
# will be gone too soon.
Expand All @@ -156,35 +107,6 @@ distclean maintainer-clean:
# Garbage from autoconf:
@rm -rf autom4te.cache/

# This is a top-level target that runs "all" regression test suites against
# a running server. This is what the CI pipeline runs.
installcheck-world:
$(MAKE) -C src/test installcheck-good
$(MAKE) -C src/test/fsync installcheck
$(MAKE) -C src/test/walrep installcheck
$(MAKE) -C src/test/heap_checksum installcheck
$(MAKE) -C src/test/isolation installcheck
$(MAKE) -C src/test/isolation2 installcheck
$(MAKE) -C src/pl installcheck
#$(MAKE) -C src/interfaces/ecpg installcheck
#$(MAKE) -C contrib installcheck
$(MAKE) -C contrib/formatter_fixedwidth installcheck
$(MAKE) -C contrib/extprotocol installcheck
$(MAKE) -C contrib/dblink installcheck
$(MAKE) -C contrib/indexscan installcheck
$(MAKE) -C contrib/hstore installcheck
$(MAKE) -C contrib/pgcrypto installcheck
$(MAKE) -C gpAux/extensions installcheck
$(MAKE) -C src/bin/gpfdist installcheck
$(MAKE) -C src/interfaces/gppc installcheck
$(MAKE) -C src/test/kerberos installcheck
$(MAKE) -C gpMgmt/bin installcheck
gpcheckcat -A
# Verify the filesystem objects are consistent between primary and mirror
$(MAKE) -C contrib/gp_replica_check installcheck

$(MAKE) -C contrib/pg_upgrade check

installcheck-resgroup:
$(MAKE) -C src/test/isolation2 $@

Expand All @@ -199,6 +121,50 @@ create-tinc-test-cluster: destroy-demo-cluster
$(MAKE) -C gpAux/gpdemo DEFAULT_QD_MAX_CONNECT=150 NUM_PRIMARY_MIRROR_PAIRS=2
. gpAux/gpdemo/gpdemo-env.sh && createdb gptest

check: all

check installcheck installcheck-parallel:
$(MAKE) -C src/test $@

$(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib,check)

# This is a top-level target that runs "all" regression test suites against
# a running server. This is what the CI pipeline runs.
.PHONY: installcheck-world

# Run all ICW targets in different directories under a recurse call, so
# that make -k works as expected. Order is significant here (for some reason,
# which probably indicates that we're relying on undefined behavior... we should
# probably pull anything order-dependent out of recurse() and back into the
# recipe body).
$(call recurse,installcheck-world,src/test,installcheck-good)
$(call recurse,installcheck-world, \
src/test/fsync \
src/test/walrep \
src/test/heap_checksum \
src/test/isolation \
src/test/isolation2 \
src/pl \
contrib/formatter_fixedwidth \
contrib/extprotocol \
contrib/dblink \
contrib/indexscan \
contrib/hstore \
contrib/pgcrypto \
gpAux/extensions \
src/bin/gpfdist \
src/interfaces/gppc \
src/test/kerberos \
gpMgmt/bin,installcheck)
.PHONY: installcheck-gpcheckcat
installcheck-world: installcheck-gpcheckcat
installcheck-gpcheckcat:
gpcheckcat -A
$(call recurse,installcheck-world,contrib/gp_replica_check,installcheck)
$(call recurse,installcheck-world,contrib/pg_upgrade,check)

$(call recurse,maintainer-check,doc src config contrib)

# Run mock tests, that don't require a running server. Arguably these should
# be part of [install]check-world, but we treat them more like part of
# compilation than regression testing, in the CI. But they are too heavy-weight
Expand Down Expand Up @@ -268,4 +234,4 @@ distcheck: dist
rm -rf $(distdir) $(dummy)
@echo "Distribution integrity checks out."

.PHONY: dist distdir distcheck docs install-docs
.PHONY: dist distdir distcheck docs install-docs world check-world install-world installcheck-world
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -11,7 +11,7 @@
# GNUmakefile won't exist yet, so we catch that case as well.


all check install installdirs installcheck installcheck-parallel installcheck-good installcheck-optfunctional uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world installcheck-resgroup:
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world installcheck-resgroup:
@if [ ! -f GNUmakefile ] ; then \
echo "You need to run the 'configure' program first. See the file"; \
echo "'INSTALL' for installation instructions." ; \
Expand Down
6 changes: 3 additions & 3 deletions README.CVS → README.git
Expand Up @@ -2,13 +2,13 @@

In a release or snapshot tarball of PostgreSQL, documentation files named
INSTALL and HISTORY will appear in this directory. However, these files are
not stored in CVS and so will not be present if you are using a CVS checkout.
If you are using CVS, you can view the most recent install instructions at:
not stored in git and so will not be present if you are using a git checkout.
If you are using git, you can view the most recent install instructions at:
http://developer.postgresql.org/docs/postgres/installation.html
and the current release notes at:
http://developer.postgresql.org/docs/postgres/release.html

Users compiling from CVS will also need compatible versions of Bison, Flex,
Users compiling from git will also need compatible versions of Bison, Flex,
and Perl, as discussed in the install documentation. These programs are not
needed when using a tarball, since the files they are needed to build are
already present in the tarball. (On Windows, however, you need Perl anyway.)
2 changes: 1 addition & 1 deletion config/ac_func_accept_argtypes.m4
Expand Up @@ -20,7 +20,7 @@ dnl
dnl NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES
dnl macro. Credit for that one goes to David MacKenzie et. al.
dnl
dnl @version Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $
dnl @version $Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $
dnl @author Daniel Richard G. <skunk@mit.edu>
dnl

Expand Down
35 changes: 22 additions & 13 deletions config/c-compiler.m4
@@ -1,5 +1,5 @@
# Macros to detect C compiler features
# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.22 2010/05/25 17:28:20 meskes Exp $
# config/c-compiler.m4


# PGAC_C_SIGNED
Expand Down Expand Up @@ -255,16 +255,21 @@ fi])# PGAC_C_VA_ARGS
# Given a string, check if the compiler supports the string as a
# command-line option. If it does, add the string to CFLAGS.
AC_DEFUN([PGAC_PROG_CC_CFLAGS_OPT],
[AC_MSG_CHECKING([if $CC supports $1])
pgac_save_CFLAGS=$CFLAGS
[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_cflags_$1])])dnl
AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar],
[pgac_save_CFLAGS=$CFLAGS
CFLAGS="$pgac_save_CFLAGS $1"
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
AC_MSG_RESULT(yes),
[CFLAGS="$pgac_save_CFLAGS"
AC_MSG_RESULT(no)])
[Ac_cachevar=yes],
[Ac_cachevar=no])
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="$pgac_save_CFLAGS"])
if test x"$Ac_cachevar" = x"yes"; then
CFLAGS="$CFLAGS $1"
fi
undefine([Ac_cachevar])dnl
])# PGAC_PROG_CC_CFLAGS_OPT


Expand Down Expand Up @@ -302,15 +307,19 @@ undefine([Ac_cachevar])dnl
# you can link to a particular function, not just whether you can link.
# In fact, we must actually check that the resulting program runs :-(
AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT],
[AC_MSG_CHECKING([if $CC supports $1])
pgac_save_LDFLAGS=$LDFLAGS
[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_ldflags_$1])])dnl
AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar],
[pgac_save_LDFLAGS=$LDFLAGS
LDFLAGS="$pgac_save_LDFLAGS $1"
AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $2 (); void (*fptr) () = $2;],[])],
AC_MSG_RESULT(yes),
[LDFLAGS="$pgac_save_LDFLAGS"
AC_MSG_RESULT(no)],
[LDFLAGS="$pgac_save_LDFLAGS"
AC_MSG_RESULT(assuming no)])
[Ac_cachevar=yes],
[Ac_cachevar=no],
[Ac_cachevar="assuming no"])
LDFLAGS="$pgac_save_LDFLAGS"])
if test x"$Ac_cachevar" = x"yes"; then
LDFLAGS="$LDFLAGS $1"
fi
undefine([Ac_cachevar])dnl
])# PGAC_PROG_CC_LDFLAGS_OPT


Expand Down
31 changes: 30 additions & 1 deletion config/c-library.m4
@@ -1,5 +1,5 @@
# Macros that test various C library quirks
# $PostgreSQL: pgsql/config/c-library.m4,v 1.34 2009/07/02 18:55:40 petere Exp $
# config/c-library.m4


# PGAC_VAR_INT_TIMEZONE
Expand Down Expand Up @@ -297,3 +297,32 @@ int main()
])dnl AC_CACHE_VAL
AC_MSG_RESULT([$pgac_cv_printf_arg_control])
])# PGAC_FUNC_PRINTF_ARG_CONTROL


# PGAC_TYPE_LOCALE_T
# ------------------
# Check for the locale_t type and find the right header file. Mac OS
# X needs xlocale.h; standard is locale.h, but glibc also has an
# xlocale.h file that we should not use.
#
AC_DEFUN([PGAC_TYPE_LOCALE_T],
[AC_CACHE_CHECK([for locale_t], pgac_cv_type_locale_t,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include <locale.h>
locale_t x;],
[])],
[pgac_cv_type_locale_t=yes],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include <xlocale.h>
locale_t x;],
[])],
[pgac_cv_type_locale_t='yes (in xlocale.h)'],
[pgac_cv_type_locale_t=no])])])
if test "$pgac_cv_type_locale_t" != no; then
AC_DEFINE(HAVE_LOCALE_T, 1,
[Define to 1 if the system has the type `locale_t'.])
fi
if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
AC_DEFINE(LOCALE_T_IN_XLOCALE, 1,
[Define to 1 if `locale_t' requires <xlocale.h>.])
fi])])# PGAC_HEADER_XLOCALE
2 changes: 1 addition & 1 deletion config/docbook.m4
@@ -1,4 +1,4 @@
# $PostgreSQL: pgsql/config/docbook.m4,v 1.11 2009/08/04 22:04:37 petere Exp $
# config/docbook.m4

# PGAC_PROG_JADE
# --------------
Expand Down

0 comments on commit 25a9039

Please sign in to comment.