diff --git a/.gitignore b/.gitignore index 663da36..96df37d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ +/postgresql-9.2.0.tar.bz2 +/postgresql-9.2.0-US.pdf /postgresql-9.1.5.tar.bz2 -/postgresql-9.1.5-US.pdf -/postgresql-9.0.8.tar.bz2 diff --git a/README.rpm-dist b/README.rpm-dist index 6d2d920..0ed6e55 100644 --- a/README.rpm-dist +++ b/README.rpm-dist @@ -1,6 +1,6 @@ README.rpm-dist ----------------------------------------------------------------------------- -Version 9.1, for the PostgreSQL 9.1 RPM set. +Version 9.2, for the PostgreSQL 9.2 RPM set. Devrim Gündüz ----------------------------------------------------------------------------- @@ -23,9 +23,9 @@ This document exists to explain the layout of the RPMs for PostgreSQL, to describe various RPM specifics, and to document special features found in the RPMset. -This document is written to be applicable to version 9.1 of PostgreSQL, +This document is written to be applicable to version 9.2 of PostgreSQL, which is the current version of the RPMs as of this writing. More to the -point, versions prior to 9.1 are not documented here. +point, versions prior to 9.2 are not documented here. This document is intended for use only with the RPMs supplied in Red Hat Enterprise Linux, CentOS and Fedora. Note that there are also "PGDG" @@ -63,14 +63,15 @@ upgrading. The user 'postgres' is created during installation of the server subpackage. This user by default is UID and GID 26. The user has the default shell set to bash, and the home directory set to /var/lib/pgsql. This user also has no -default password. If you want to be able to su to it from a non-root account -or login as 'postgres' you will need to set a password using passwd. +default password, so the only way to become this user is to su to it from root. +If you want to be able to su to it from a non-root account or log in directly +as 'postgres' you will need to set a password using passwd. UPGRADING AN INSTALLATION ----------------------------------------------------------------------------- -For a minor-version upgrade (such as 9.1.1 to 9.1.2), just install the +For a minor-version upgrade (such as 9.2.1 to 9.2.2), just install the new RPMs; there's usually nothing more to it than that. Upgrading -across a major release of PostgreSQL (for example, from 9.0.x to 9.1.x) +across a major release of PostgreSQL (for example, from 9.1.x to 9.2.x) requires more effort. If you are upgrading across more than one major release of PostgreSQL @@ -82,7 +83,7 @@ and run the dump file through psql to restore your data. In some major releases, the RPMs also support in-place upgrade from the immediately previous major release. Currently, you can upgrade in-place -from 9.0.x to 9.1.x. This is much faster than a dump and reload. +from 9.1.x to 9.2.x. This is much faster than a dump and reload. To do an in-place upgrade: * shut down the old postmaster ("systemctl stop postgresql.service") * optionally make a backup of /var/lib/pgsql/data/ (recommended!) @@ -115,9 +116,10 @@ postgresql-devel: Development libraries and include files postgresql-test: The regression tests and associated files postgresql-upgrade: Support files for upgrading from previous major version postgresql-docs: Extra documentation, such as the tutorial files -postgresql-contrib: The contrib source tree, as well as selected binaries +postgresql-contrib: Add-on loadable modules and programs postgresql-plperl: PL/Perl procedural language -postgresql-plpython: PL/Python procedural language +postgresql-plpython: PL/Python procedural language (for Python 2) +postgresql-plpython3: PL/Python procedural language (for Python 3) postgresql-pltcl: PL/Tcl procedural language You have to install postgresql and postgresql-libs to do anything. @@ -145,7 +147,7 @@ However, the Red Hat / CentOS / Fedora RPM's install the files like this: Executables: /usr/bin -Libraries: /usr/lib (or /usr/lib64) +Libraries: /usr/lib (or /usr/lib64 on 64-bit machines) Documentation: /usr/share/doc/postgresql-docs-x.y.z/html Contrib documentation: /usr/share/doc/postgresql-contrib-x.y.z Source: not installed @@ -196,8 +198,8 @@ As an example, let us create a secondary postmaster called, creatively enough, You will probably also want to do 'systemctl enable secondary.service' so that the new postmaster is automatically started in future reboots. -When doing a major-version upgrade of a secondary postmaster, mention the -service name in the postgresql-setup command, for example 'postgresql-setup +When doing a major-version upgrade of a secondary postmaster, add the +service name to the postgresql-setup command, for example 'postgresql-setup upgrade secondary'. This will let postgresql-setup find the correct data directory from the service file. @@ -223,8 +225,8 @@ your database machine is up to the task. To run the regression tests under the RPM installation, make sure that the postmaster has been started (if not, su to root and do "systemctl start -postgresql.service"), cd to /usr/lib/pgsql/test/regress (or -/usr/lib64/pgsql/test/regress on a 64-bit machine), su to postgres, +postgresql.service"), su to postgres, cd to /usr/lib/pgsql/test/regress +(or /usr/lib64/pgsql/test/regress on a 64-bit machine), and execute "make check". This command will start the regression tests and will both show the results to the screen and store the results in the file regress.out. @@ -235,8 +237,8 @@ find out whether the differences are actually significant. If you need help interpreting the results, contact the pgsql-general list at postgresql.org. -After testing, say "make clean" to remove the files generated by the test -script. +After testing, run "make clean" to remove the files generated by the test +script. Then you can remove the postgresql-test RPM, if you wish. STARTING POSTMASTER AUTOMATICALLY AT SYSTEM STARTUP ------------------------------------------------------------------------------- @@ -279,41 +281,52 @@ day of the week. You can adjust this by changing postgresql.conf settings. REBUILDING FROM SOURCE RPM ------------------------------------------------------------------------------- If your distribution is not supported by the binary RPMs from PostgreSQL.org, -you will need to rebuild from the source RPM. Download the .src.rpm for this -release. You will need to be root to rebuild, unless you have set up -a non-root build environment (which is the recommended method anyway). +you will need to rebuild from the source RPM. -Install the source RPM with rpm -i, then cd to the rpm building area -(which is /usr/src/redhat by default). You will have to have a full -development environment to rebuild the full RPM set. +If you have not previously rebuilt any RPMs, set up the required environment: +make a work directory, say ~/rpmwork, then cd into it and do + mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS +Then make a file ~/.rpmmacros containing + %_topdir + +Download the postgresql .src.rpm for the release you want and place it in +the SRPMS subdirectory, then cd there and execute + rpmbuild --rebuild postgresql-nnn.src.rpm +The results will appear under the RPMS subdirectory. + +You will have to have a full development environment to rebuild the RPM set. +If rpmbuild complains of lack of certain packages, install them and try +again. In some cases, you can disable features to avoid needing some +development packages, as detailed next. This release of the RPMset includes the ability to conditionally build sets of packages. The parameters, their defaults, and the meanings are: beta 0 #build with cassert and do not strip the binaries -python 1 #build the postgresql-python package. -tcl 1 #build the postgresql-tcl package. -test 1 #build the postgresql-test package. -plpython 1 #build the PL/Python procedural language package. -pltcl 1 #build the PL/Tcl procedural language package. -plperl 1 #build the PL/Perl procedural language package. -ssl 1 #use OpenSSL support. -kerberos 1 #use Kerberos 5 support. -nls 1 #build with national language support. -ldap 1 #build with LDAP support. -pam 1 #build with PAM support. -runselftest 1 #do "make check" during the build. -sdt 1 #build with SystemTap support. +runselftest 1 #do "make check" during the build +test 1 #build the postgresql-test package +upgrade 1 #build the postgresql-upgrade package +plpython 1 #build the PL/Python procedural language package +plpython3 1 #build the PL/Python3 procedural language package +pltcl 1 #build the PL/Tcl procedural language package +plperl 1 #build the PL/Perl procedural language package +ssl 1 #build with OpenSSL support +kerberos 1 #build with Kerberos 5 support +ldap 1 #build with LDAP support +nls 1 #build with national language support +pam 1 #build with PAM support +sdt 1 #build with SystemTap support xml 1 #build with XML support pgfts 1 #build with --enable-thread-safety +selinux 1 #build contrib/selinux uuid 1 #build contrib/uuid-ossp To use these defines, invoke a rebuild like this: -rpmbuild --rebuild --define 'python 0' --define 'tcl 0' \ +rpmbuild --rebuild --define 'plpython 0' --define 'pltcl 0' \ --define 'test 0' --define 'runselftest 0' --define 'kerberos 0' \ - postgresql-9.1.2-1.src.rpm -This line would disable the python, tcl, and test subpackages, disable the -regression test run during build, and disable kerberos support. + postgresql-9.2.0-1.src.rpm +This line would disable the plpython, pltcl, and test subpackages, disable +the regression test run during build, and disable kerberos support. You might need to disable runselftest if there is an installed version of PostgreSQL that is a different major version from what you are trying to diff --git a/postgresql-config-comment.patch b/postgresql-config-comment.patch index f392802..9df0221 100644 --- a/postgresql-config-comment.patch +++ b/postgresql-config-comment.patch @@ -5,11 +5,11 @@ to doing it this way though, for example that the postmaster's port number is visible in "ps" as part of its command line.) -diff -Naur postgresql-9.1.5.orig/src/backend/utils/misc/postgresql.conf.sample postgresql-9.1.5/src/backend/utils/misc/postgresql.conf.sample ---- postgresql-9.1.5.orig/src/backend/utils/misc/postgresql.conf.sample 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/utils/misc/postgresql.conf.sample 2012-08-17 11:37:03.400210802 -0400 +diff -Naur postgresql-9.2rc1.orig/src/backend/utils/misc/postgresql.conf.sample postgresql-9.2rc1/src/backend/utils/misc/postgresql.conf.sample +--- postgresql-9.2rc1.orig/src/backend/utils/misc/postgresql.conf.sample 2012-08-23 18:06:49.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/utils/misc/postgresql.conf.sample 2012-09-01 21:57:55.498629897 -0400 @@ -61,6 +61,8 @@ - # defaults to 'localhost', '*' = all + # defaults to 'localhost'; use '*' for all # (change requires restart) #port = 5432 # (change requires restart) +# Note: In RHEL/Fedora installations, you can't set the port number here; diff --git a/postgresql-multi-sockets.patch b/postgresql-multi-sockets.patch index 0dcbe9b..7cb2789 100644 --- a/postgresql-multi-sockets.patch +++ b/postgresql-multi-sockets.patch @@ -9,10 +9,23 @@ files. We don't want that to happen because the BuildRequires for the package don't include the necessary documentation tools. -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/client-auth.sgml postgresql-9.1.5/doc/src/sgml/client-auth.sgml ---- postgresql-9.1.5.orig/doc/src/sgml/client-auth.sgml 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/client-auth.sgml 2012-09-06 11:53:55.188679276 -0400 -@@ -831,7 +831,7 @@ +diff -Naur postgresql-9.2rc1.orig/contrib/pg_upgrade/server.c postgresql-9.2rc1/contrib/pg_upgrade/server.c +--- postgresql-9.2rc1.orig/contrib/pg_upgrade/server.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/contrib/pg_upgrade/server.c 2012-09-06 12:06:22.425763034 -0400 +@@ -197,7 +197,8 @@ + snprintf(socket_string + strlen(socket_string), + sizeof(socket_string) - strlen(socket_string), + " -c %s='%s'", +- (GET_MAJOR_VERSION(cluster->major_version) < 903) ? ++ /* assume 9.1 build will not have unix_socket_directories patch */ ++ (GET_MAJOR_VERSION(cluster->major_version) < 902) ? + "unix_socket_directory" : "unix_socket_directories", + cluster->sockdir); + #endif +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/client-auth.sgml postgresql-9.2rc1/doc/src/sgml/client-auth.sgml +--- postgresql-9.2rc1.orig/doc/src/sgml/client-auth.sgml 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/client-auth.sgml 2012-09-06 12:06:22.426763044 -0400 +@@ -838,7 +838,7 @@ unix_socket_permissions (and possibly unix_socket_group) configuration parameters as described in . Or you @@ -21,10 +34,10 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/client-auth.sgml postgresql-9.1.5/ configuration parameter to place the socket file in a suitably restricted directory. -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/src/sgml/config.sgml ---- postgresql-9.1.5.orig/doc/src/sgml/config.sgml 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/config.sgml 2012-09-06 11:53:55.200679690 -0400 -@@ -417,17 +417,24 @@ +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/config.sgml postgresql-9.2rc1/doc/src/sgml/config.sgml +--- postgresql-9.2rc1.orig/doc/src/sgml/config.sgml 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/config.sgml 2012-09-06 12:06:22.428763063 -0400 +@@ -453,17 +453,24 @@ @@ -56,7 +69,7 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/s This parameter can only be set at server start. -@@ -436,8 +443,8 @@ +@@ -472,8 +479,8 @@ .s.PGSQL.nnnn where nnnn is the server's port number, an ordinary file named .s.PGSQL.nnnn.lock will be @@ -67,7 +80,7 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/s -@@ -454,8 +461,8 @@ +@@ -490,8 +497,8 @@ @@ -78,7 +91,7 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/s server.) In combination with the parameter unix_socket_permissions this can be used as an additional access control mechanism for Unix-domain connections. -@@ -478,7 +485,7 @@ +@@ -514,7 +521,7 @@ @@ -87,7 +100,7 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/s sockets use the usual Unix file system permission set. The parameter value is expected to be a numeric mode specified in the format accepted by the -@@ -6417,7 +6424,7 @@ +@@ -6606,7 +6613,7 @@ @@ -96,10 +109,10 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/config.sgml postgresql-9.1.5/doc/s -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html/app-postgres.html postgresql-9.1.5/doc/src/sgml/html/app-postgres.html ---- postgresql-9.1.5.orig/doc/src/sgml/html/app-postgres.html 2012-08-14 18:56:14.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/html/app-postgres.html 2012-09-06 11:53:55.201679728 -0400 -@@ -531,11 +531,19 @@ +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/html/app-postgres.html postgresql-9.2rc1/doc/src/sgml/html/app-postgres.html +--- postgresql-9.2rc1.orig/doc/src/sgml/html/app-postgres.html 2012-09-05 13:24:03.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/html/app-postgres.html 2012-09-06 12:06:22.429763072 -0400 +@@ -574,11 +574,19 @@ CLASS="COMMAND" >postgres is to listen for @@ -121,9 +134,9 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html/app-postgres.html postgresql-

. Or you could set the configuration parameter to place the socket file in a suitably restricted directory. -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html/bookindex.html postgresql-9.1.5/doc/src/sgml/html/bookindex.html ---- postgresql-9.1.5.orig/doc/src/sgml/html/bookindex.html 2012-08-14 18:56:48.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/html/bookindex.html 2012-09-06 11:53:55.204679820 -0400 -@@ -16893,7 +16893,7 @@ +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/html/bookindex.html postgresql-9.2rc1/doc/src/sgml/html/bookindex.html +--- postgresql-9.2rc1.orig/doc/src/sgml/html/bookindex.html 2012-09-05 13:24:38.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/html/bookindex.html 2012-09-06 12:06:22.433763111 -0400 +@@ -17236,7 +17236,7 @@ >
Connection Settingslocal @@ -159,9 +172,9 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html/preventing-server-spoofing.ht >) that has write permission only for a trusted local user. This prevents a malicious user from creating their own socket file in that directory. If you are concerned that -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html/runtime-config-connection.html postgresql-9.1.5/doc/src/sgml/html/runtime-config-connection.html ---- postgresql-9.1.5.orig/doc/src/sgml/html/runtime-config-connection.html 2012-08-14 18:55:56.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/html/runtime-config-connection.html 2012-09-06 11:53:55.205679845 -0400 +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/html/runtime-config-connection.html postgresql-9.2rc1/doc/src/sgml/html/runtime-config-connection.html +--- postgresql-9.2rc1.orig/doc/src/sgml/html/runtime-config-connection.html 2012-09-05 13:23:45.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/html/runtime-config-connection.html 2012-09-06 12:06:22.435763129 -0400 @@ -274,24 +274,31 @@ >
x Specifies the directory of the Unix-domain socket on which postgres is to listen for @@ -284,10 +297,10 @@ diff -Naur postgresql-9.1.5.orig/doc/src/sgml/ref/postgres-ref.sgml postgresql-9 -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/runtime.sgml postgresql-9.1.5/doc/src/sgml/runtime.sgml ---- postgresql-9.1.5.orig/doc/src/sgml/runtime.sgml 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/runtime.sgml 2012-09-06 11:53:55.208679918 -0400 -@@ -1816,7 +1816,7 @@ +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/runtime.sgml postgresql-9.2rc1/doc/src/sgml/runtime.sgml +--- postgresql-9.2rc1.orig/doc/src/sgml/runtime.sgml 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/runtime.sgml 2012-09-06 12:06:22.438763157 -0400 +@@ -1798,7 +1798,7 @@ The simplest way to prevent spoofing for local connections is to use a Unix domain socket directory (/tmp for the -diff -Naur postgresql-9.1.5.orig/src/backend/libpq/pqcomm.c postgresql-9.1.5/src/backend/libpq/pqcomm.c ---- postgresql-9.1.5.orig/src/backend/libpq/pqcomm.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/libpq/pqcomm.c 2012-09-06 11:53:55.209679942 -0400 +diff -Naur postgresql-9.2rc1.orig/src/backend/libpq/pqcomm.c postgresql-9.2rc1/src/backend/libpq/pqcomm.c +--- postgresql-9.2rc1.orig/src/backend/libpq/pqcomm.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/libpq/pqcomm.c 2012-09-06 12:06:22.439763167 -0400 @@ -42,7 +42,7 @@ * StreamServerPort - Open postmaster's server port * StreamConnection - Create new connection with client @@ -508,10 +521,10 @@ diff -Naur postgresql-9.1.5.orig/src/backend/libpq/pqcomm.c postgresql-9.1.5/src /* * utime() is POSIX standard, utimes() is a common alternative. If we * have neither, there's no way to affect the mod or access time of -diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql-9.1.5/src/backend/postmaster/postmaster.c ---- postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/postmaster/postmaster.c 2012-09-06 11:53:55.210679959 -0400 -@@ -157,7 +157,9 @@ +diff -Naur postgresql-9.2rc1.orig/src/backend/postmaster/postmaster.c postgresql-9.2rc1/src/backend/postmaster/postmaster.c +--- postgresql-9.2rc1.orig/src/backend/postmaster/postmaster.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/postmaster/postmaster.c 2012-09-06 12:06:22.441763187 -0400 +@@ -156,7 +156,9 @@ /* The socket number we are listening for connections on */ int PostPortNumber; @@ -522,7 +535,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- char *ListenAddresses; /* -@@ -590,7 +592,7 @@ +@@ -608,7 +610,7 @@ break; case 'k': @@ -531,7 +544,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- break; case 'l': -@@ -848,7 +850,7 @@ +@@ -852,7 +854,7 @@ /* Need a modifiable copy of ListenAddresses */ rawstring = pstrdup(ListenAddresses); @@ -540,7 +553,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- if (!SplitIdentifierString(rawstring, ',', &elemlist)) { /* syntax error in list */ -@@ -864,12 +866,12 @@ +@@ -868,12 +870,12 @@ if (strcmp(curhost, "*") == 0) status = StreamServerPort(AF_UNSPEC, NULL, (unsigned short) PostPortNumber, @@ -555,7 +568,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- ListenSocket, MAXLISTEN); if (status == STATUS_OK) -@@ -888,7 +890,7 @@ +@@ -892,7 +894,7 @@ curhost))); } @@ -564,7 +577,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- ereport(FATAL, (errmsg("could not create any TCP/IP sockets"))); -@@ -935,13 +937,54 @@ +@@ -939,13 +941,54 @@ #endif #ifdef HAVE_UNIX_SOCKETS @@ -626,7 +639,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- #endif /* -@@ -1529,15 +1572,15 @@ +@@ -1435,15 +1478,15 @@ } /* @@ -645,10 +658,10 @@ diff -Naur postgresql-9.1.5.orig/src/backend/postmaster/postmaster.c postgresql- last_touch_time = now; } } -diff -Naur postgresql-9.1.5.orig/src/backend/tcop/postgres.c postgresql-9.1.5/src/backend/tcop/postgres.c ---- postgresql-9.1.5.orig/src/backend/tcop/postgres.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/tcop/postgres.c 2012-09-06 11:53:55.211679977 -0400 -@@ -3345,7 +3345,7 @@ +diff -Naur postgresql-9.2rc1.orig/src/backend/tcop/postgres.c postgresql-9.2rc1/src/backend/tcop/postgres.c +--- postgresql-9.2rc1.orig/src/backend/tcop/postgres.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/tcop/postgres.c 2012-09-06 12:06:22.442763197 -0400 +@@ -3343,7 +3343,7 @@ break; case 'k': @@ -657,10 +670,10 @@ diff -Naur postgresql-9.1.5.orig/src/backend/tcop/postgres.c postgresql-9.1.5/sr break; case 'l': -diff -Naur postgresql-9.1.5.orig/src/backend/utils/adt/varlena.c postgresql-9.1.5/src/backend/utils/adt/varlena.c ---- postgresql-9.1.5.orig/src/backend/utils/adt/varlena.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/utils/adt/varlena.c 2012-09-06 11:54:14.148859548 -0400 -@@ -2387,6 +2387,119 @@ +diff -Naur postgresql-9.2rc1.orig/src/backend/utils/adt/varlena.c postgresql-9.2rc1/src/backend/utils/adt/varlena.c +--- postgresql-9.2rc1.orig/src/backend/utils/adt/varlena.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/utils/adt/varlena.c 2012-09-06 12:06:39.209922137 -0400 +@@ -2446,6 +2446,119 @@ } @@ -780,9 +793,9 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/adt/varlena.c postgresql-9.1. /***************************************************************************** * Comparison Functions used for bytea * -diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9.1.5/src/backend/utils/init/miscinit.c ---- postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/utils/init/miscinit.c 2012-09-06 11:53:55.213680015 -0400 +diff -Naur postgresql-9.2rc1.orig/src/backend/utils/init/miscinit.c postgresql-9.2rc1/src/backend/utils/init/miscinit.c +--- postgresql-9.2rc1.orig/src/backend/utils/init/miscinit.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/utils/init/miscinit.c 2012-09-06 12:06:22.445763224 -0400 @@ -49,8 +49,8 @@ ProcessingMode Mode = InitProcessing; @@ -794,7 +807,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. /* ---------------------------------------------------------------- -@@ -648,32 +648,35 @@ +@@ -640,32 +640,35 @@ */ /* @@ -840,7 +853,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. bool isDDLock, const char *refName) { int fd; -@@ -899,12 +902,7 @@ +@@ -891,12 +894,7 @@ DataDir, (long) MyStartTime, PostPortNumber, @@ -854,7 +867,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. errno = 0; if (write(fd, buffer, strlen(buffer)) != strlen(buffer)) -@@ -942,9 +940,14 @@ +@@ -934,9 +932,14 @@ } /* @@ -871,7 +884,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. } /* -@@ -953,41 +956,50 @@ +@@ -945,41 +948,50 @@ * When this is called, we must have already switched the working * directory to DataDir, so we can just use a relative path. This * helps ensure that we are locking the directory we should be. @@ -933,7 +946,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. /* * utime() is POSIX standard, utimes() is a common alternative; if we * have neither, fall back to actually reading the file (which only -@@ -1019,8 +1031,10 @@ +@@ -1011,8 +1023,10 @@ * Add (or replace) a line in the data directory lock file. * The given string should not include a trailing newline. * @@ -946,7 +959,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. */ void AddToDataDirLockFile(int target_line, const char *str) -@@ -1028,8 +1042,10 @@ +@@ -1020,8 +1034,10 @@ int fd; int len; int lineno; @@ -959,7 +972,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. fd = open(DIRECTORY_LOCK_FILE, O_RDWR | PG_BINARY, 0); if (fd < 0) -@@ -1040,7 +1056,7 @@ +@@ -1032,7 +1048,7 @@ DIRECTORY_LOCK_FILE))); return; } @@ -968,7 +981,7 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. if (len < 0) { ereport(LOG, -@@ -1050,36 +1066,50 @@ +@@ -1042,36 +1058,50 @@ close(fd); return; } @@ -1027,10 +1040,10 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/init/miscinit.c postgresql-9. { /* if write didn't set errno, assume problem is no disk space */ if (errno == 0) -diff -Naur postgresql-9.1.5.orig/src/backend/utils/misc/guc.c postgresql-9.1.5/src/backend/utils/misc/guc.c ---- postgresql-9.1.5.orig/src/backend/utils/misc/guc.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/utils/misc/guc.c 2012-09-06 11:53:55.215680028 -0400 -@@ -2867,14 +2867,18 @@ +diff -Naur postgresql-9.2rc1.orig/src/backend/utils/misc/guc.c postgresql-9.2rc1/src/backend/utils/misc/guc.c +--- postgresql-9.2rc1.orig/src/backend/utils/misc/guc.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/utils/misc/guc.c 2012-09-06 12:06:22.447763243 -0400 +@@ -2894,14 +2894,18 @@ }, { @@ -1053,9 +1066,9 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/misc/guc.c postgresql-9.1.5/s }, { -diff -Naur postgresql-9.1.5.orig/src/backend/utils/misc/postgresql.conf.sample postgresql-9.1.5/src/backend/utils/misc/postgresql.conf.sample ---- postgresql-9.1.5.orig/src/backend/utils/misc/postgresql.conf.sample 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/backend/utils/misc/postgresql.conf.sample 2012-09-06 11:53:55.216680035 -0400 +diff -Naur postgresql-9.2rc1.orig/src/backend/utils/misc/postgresql.conf.sample postgresql-9.2rc1/src/backend/utils/misc/postgresql.conf.sample +--- postgresql-9.2rc1.orig/src/backend/utils/misc/postgresql.conf.sample 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/backend/utils/misc/postgresql.conf.sample 2012-09-06 12:06:22.447763243 -0400 @@ -65,7 +65,8 @@ # Note: Increasing max_connections costs ~400 bytes of shared memory per # connection slot, plus lock space (see max_locks_per_transaction). @@ -1066,19 +1079,19 @@ diff -Naur postgresql-9.1.5.orig/src/backend/utils/misc/postgresql.conf.sample p #unix_socket_group = '' # (change requires restart) #unix_socket_permissions = 0777 # begin with 0 to use octal notation # (change requires restart) -diff -Naur postgresql-9.1.5.orig/src/bin/initdb/initdb.c postgresql-9.1.5/src/bin/initdb/initdb.c ---- postgresql-9.1.5.orig/src/bin/initdb/initdb.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/bin/initdb/initdb.c 2012-09-06 11:53:55.217680041 -0400 -@@ -947,7 +947,7 @@ +diff -Naur postgresql-9.2rc1.orig/src/bin/initdb/initdb.c postgresql-9.2rc1/src/bin/initdb/initdb.c +--- postgresql-9.2rc1.orig/src/bin/initdb/initdb.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/bin/initdb/initdb.c 2012-09-06 12:06:22.448763252 -0400 +@@ -979,7 +979,7 @@ setup_config(void) { char **conflines; -- char repltok[100]; +- char repltok[TZ_STRLEN_MAX + 100]; + char repltok[MAXPGPATH]; char path[MAXPGPATH]; + const char *default_timezone; - fputs(_("creating configuration files ... "), stdout); -@@ -968,6 +968,15 @@ +@@ -1001,6 +1001,15 @@ n_buffers * (BLCKSZ / 1024)); conflines = replace_token(conflines, "#shared_buffers = 32MB", repltok); @@ -1094,10 +1107,10 @@ diff -Naur postgresql-9.1.5.orig/src/bin/initdb/initdb.c postgresql-9.1.5/src/bi #if DEF_PGPORT != 5432 snprintf(repltok, sizeof(repltok), "#port = %d", DEF_PGPORT); conflines = replace_token(conflines, "#port = 5432", repltok); -diff -Naur postgresql-9.1.5.orig/src/bin/pg_ctl/pg_ctl.c postgresql-9.1.5/src/bin/pg_ctl/pg_ctl.c ---- postgresql-9.1.5.orig/src/bin/pg_ctl/pg_ctl.c 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/bin/pg_ctl/pg_ctl.c 2012-09-06 11:53:55.218680049 -0400 -@@ -519,7 +519,7 @@ +diff -Naur postgresql-9.2rc1.orig/src/bin/pg_ctl/pg_ctl.c postgresql-9.2rc1/src/bin/pg_ctl/pg_ctl.c +--- postgresql-9.2rc1.orig/src/bin/pg_ctl/pg_ctl.c 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/bin/pg_ctl/pg_ctl.c 2012-09-06 12:06:22.449763262 -0400 +@@ -521,7 +521,7 @@ hostaddr = optlines[LOCK_FILE_LINE_LISTEN_ADDR - 1]; /* @@ -1106,9 +1119,9 @@ diff -Naur postgresql-9.1.5.orig/src/bin/pg_ctl/pg_ctl.c postgresql-9.1.5/src/bi * directories, libpq's host parameter must have a * leading slash to indicate a socket directory. So, * ignore sockdir if it's relative, and try to use TCP -diff -Naur postgresql-9.1.5.orig/src/include/libpq/libpq.h postgresql-9.1.5/src/include/libpq/libpq.h ---- postgresql-9.1.5.orig/src/include/libpq/libpq.h 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/include/libpq/libpq.h 2012-09-06 11:53:55.218680049 -0400 +diff -Naur postgresql-9.2rc1.orig/src/include/libpq/libpq.h postgresql-9.2rc1/src/include/libpq/libpq.h +--- postgresql-9.2rc1.orig/src/include/libpq/libpq.h 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/include/libpq/libpq.h 2012-09-06 12:06:22.450763271 -0400 @@ -44,12 +44,12 @@ /* * prototypes for functions in pqcomm.c @@ -1126,10 +1139,10 @@ diff -Naur postgresql-9.1.5.orig/src/include/libpq/libpq.h postgresql-9.1.5/src/ extern void pq_init(void); extern void pq_comm_reset(void); extern int pq_getbytes(char *s, size_t len); -diff -Naur postgresql-9.1.5.orig/src/include/miscadmin.h postgresql-9.1.5/src/include/miscadmin.h ---- postgresql-9.1.5.orig/src/include/miscadmin.h 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/include/miscadmin.h 2012-09-06 11:53:55.219680061 -0400 -@@ -370,7 +370,7 @@ +diff -Naur postgresql-9.2rc1.orig/src/include/miscadmin.h postgresql-9.2rc1/src/include/miscadmin.h +--- postgresql-9.2rc1.orig/src/include/miscadmin.h 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/include/miscadmin.h 2012-09-06 12:06:22.450763271 -0400 +@@ -411,7 +411,7 @@ * 2 data directory path * 3 postmaster start timestamp (time_t representation) * 4 port number @@ -1138,7 +1151,7 @@ diff -Naur postgresql-9.1.5.orig/src/include/miscadmin.h postgresql-9.1.5/src/in * 6 first listen_address (IP address or "*"; empty if no TCP port) * 7 shared memory key (not present on Windows) * -@@ -388,8 +388,9 @@ +@@ -429,8 +429,9 @@ #define LOCK_FILE_LINE_SHMEM_KEY 7 extern void CreateDataDirLockFile(bool amPostmaster); @@ -1150,10 +1163,10 @@ diff -Naur postgresql-9.1.5.orig/src/include/miscadmin.h postgresql-9.1.5/src/in extern void AddToDataDirLockFile(int target_line, const char *str); extern void ValidatePgVersion(const char *path); extern void process_shared_preload_libraries(void); -diff -Naur postgresql-9.1.5.orig/src/include/postmaster/postmaster.h postgresql-9.1.5/src/include/postmaster/postmaster.h ---- postgresql-9.1.5.orig/src/include/postmaster/postmaster.h 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/include/postmaster/postmaster.h 2012-09-06 11:53:55.219680061 -0400 -@@ -20,7 +20,7 @@ +diff -Naur postgresql-9.2rc1.orig/src/include/postmaster/postmaster.h postgresql-9.2rc1/src/include/postmaster/postmaster.h +--- postgresql-9.2rc1.orig/src/include/postmaster/postmaster.h 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/include/postmaster/postmaster.h 2012-09-06 12:06:22.451763281 -0400 +@@ -19,7 +19,7 @@ extern int PostPortNumber; extern int Unix_socket_permissions; extern char *Unix_socket_group; @@ -1162,10 +1175,10 @@ diff -Naur postgresql-9.1.5.orig/src/include/postmaster/postmaster.h postgresql- extern char *ListenAddresses; extern bool ClientAuthInProgress; extern int PreAuthDelay; -diff -Naur postgresql-9.1.5.orig/src/include/utils/builtins.h postgresql-9.1.5/src/include/utils/builtins.h ---- postgresql-9.1.5.orig/src/include/utils/builtins.h 2012-08-14 18:41:04.000000000 -0400 -+++ postgresql-9.1.5/src/include/utils/builtins.h 2012-09-06 11:53:55.220680072 -0400 -@@ -728,6 +728,8 @@ +diff -Naur postgresql-9.2rc1.orig/src/include/utils/builtins.h postgresql-9.2rc1/src/include/utils/builtins.h +--- postgresql-9.2rc1.orig/src/include/utils/builtins.h 2012-09-05 01:08:30.000000000 -0400 ++++ postgresql-9.2rc1/src/include/utils/builtins.h 2012-09-06 12:06:22.451763281 -0400 +@@ -754,6 +754,8 @@ extern List *textToQualifiedNameList(text *textval); extern bool SplitIdentifierString(char *rawstring, char separator, List **namelist); @@ -1174,13 +1187,13 @@ diff -Naur postgresql-9.1.5.orig/src/include/utils/builtins.h postgresql-9.1.5/s extern Datum replace_text(PG_FUNCTION_ARGS); extern text *replace_text_regexp(text *src_text, void *regexp, text *replace_text, bool glob); -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/html-stamp postgresql-9.1.5/doc/src/sgml/html-stamp ---- postgresql-9.1.5.orig/doc/src/sgml/html-stamp 2012-08-14 18:56:48.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/html-stamp 2012-09-06 11:53:55.220680072 -0400 +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/html-stamp postgresql-9.2rc1/doc/src/sgml/html-stamp +--- postgresql-9.2rc1.orig/doc/src/sgml/html-stamp 2012-09-05 13:24:38.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/html-stamp 2012-09-06 12:06:22.452763290 -0400 @@ -0,0 +1 @@ +hack -diff -Naur postgresql-9.1.5.orig/doc/src/sgml/man-stamp postgresql-9.1.5/doc/src/sgml/man-stamp ---- postgresql-9.1.5.orig/doc/src/sgml/man-stamp 2012-08-14 18:57:47.000000000 -0400 -+++ postgresql-9.1.5/doc/src/sgml/man-stamp 2012-09-06 11:53:55.220680072 -0400 +diff -Naur postgresql-9.2rc1.orig/doc/src/sgml/man-stamp postgresql-9.2rc1/doc/src/sgml/man-stamp +--- postgresql-9.2rc1.orig/doc/src/sgml/man-stamp 2012-09-05 13:25:43.000000000 -0400 ++++ postgresql-9.2rc1/doc/src/sgml/man-stamp 2012-09-06 12:06:22.452763290 -0400 @@ -0,0 +1 @@ +hack diff --git a/postgresql-oom_score_adj.patch b/postgresql-oom_score_adj.patch deleted file mode 100644 index aade1d5..0000000 --- a/postgresql-oom_score_adj.patch +++ /dev/null @@ -1,52 +0,0 @@ -Back-patch upstream's 9.2 patch to add support for setting oom_score_adj. - - -diff -Naur postgresql-9.1.4.orig/src/backend/postmaster/fork_process.c postgresql-9.1.4/src/backend/postmaster/fork_process.c ---- postgresql-9.1.4.orig/src/backend/postmaster/fork_process.c 2012-05-31 19:07:09.000000000 -0400 -+++ postgresql-9.1.4/src/backend/postmaster/fork_process.c 2012-07-14 17:55:42.911859485 -0400 -@@ -68,12 +68,40 @@ - * process sizes *including shared memory*. (This is unbelievably - * stupid, but the kernel hackers seem uninterested in improving it.) - * Therefore it's often a good idea to protect the postmaster by -- * setting its oom_adj value negative (which has to be done in a -- * root-owned startup script). If you just do that much, all child -+ * setting its oom_score_adj value negative (which has to be done in a -+ * root-owned startup script). If you just do that much, all child - * processes will also be protected against OOM kill, which might not -- * be desirable. You can then choose to build with LINUX_OOM_ADJ -- * #defined to 0, or some other value that you want child processes to -- * adopt here. -+ * be desirable. You can then choose to build with -+ * LINUX_OOM_SCORE_ADJ #defined to 0, or to some other value that you -+ * want child processes to adopt here. -+ */ -+#ifdef LINUX_OOM_SCORE_ADJ -+ { -+ /* -+ * Use open() not stdio, to ensure we control the open flags. Some -+ * Linux security environments reject anything but O_WRONLY. -+ */ -+ int fd = open("/proc/self/oom_score_adj", O_WRONLY, 0); -+ -+ /* We ignore all errors */ -+ if (fd >= 0) -+ { -+ char buf[16]; -+ int rc; -+ -+ snprintf(buf, sizeof(buf), "%d\n", LINUX_OOM_SCORE_ADJ); -+ rc = write(fd, buf, strlen(buf)); -+ (void) rc; -+ close(fd); -+ } -+ } -+#endif /* LINUX_OOM_SCORE_ADJ */ -+ -+ /* -+ * Older Linux kernels have oom_adj not oom_score_adj. This works -+ * similarly except with a different scale of adjustment values. -+ * If it's necessary to build Postgres to work with either API, -+ * you can define both LINUX_OOM_SCORE_ADJ and LINUX_OOM_ADJ. - */ - #ifdef LINUX_OOM_ADJ - { diff --git a/postgresql-python3.patch b/postgresql-python3.patch new file mode 100644 index 0000000..f67383f --- /dev/null +++ b/postgresql-python3.patch @@ -0,0 +1,62 @@ +This won't be needed in 9.2.1 and later. + + +commit 770556d6c69c4edf219d4ace2e4fb29a1f2c35df +Author: Tom Lane +Date: Sat Sep 8 17:39:02 2012 -0400 + + Adjust PL/Python regression tests some more for Python 3.3. + + Commit 2cfb1c6f77734db81b6e74bcae630f93b94f69be fixed some issues caused + by Python 3.3 choosing to iterate through dict entries in a different order + than before. But here's another one: the test cases adjusted here made two + bad entries in a dict and expected the one complained of would always be + the same. + + Possibly this should be back-patched further than 9.2, but there seems + little point unless the earlier fix is too. + +diff --git a/src/pl/plpython/expected/plpython_trigger.out b/src/pl/plpython/expected/plpython_trigger.out +index 4c46b2b..25060b0 100644 +--- a/src/pl/plpython/expected/plpython_trigger.out ++++ b/src/pl/plpython/expected/plpython_trigger.out +@@ -476,7 +476,7 @@ DROP TRIGGER stupid_trigger6 ON trigger_test; + -- TD keys not corresponding to row columns + CREATE FUNCTION stupid7() RETURNS trigger + AS $$ +- TD["new"] = {'a': 'foo', 'b': 'bar'} ++ TD["new"] = {'v': 'foo', 'a': 'bar'} + return "MODIFY"; + $$ LANGUAGE plpythonu; + CREATE TRIGGER stupid_trigger7 +@@ -490,7 +490,7 @@ DROP TRIGGER stupid_trigger7 ON trigger_test; + -- Unicode variant + CREATE FUNCTION stupid7u() RETURNS trigger + AS $$ +- TD["new"] = {u'a': 'foo', u'b': 'bar'} ++ TD["new"] = {u'v': 'foo', u'a': 'bar'} + return "MODIFY" + $$ LANGUAGE plpythonu; + CREATE TRIGGER stupid_trigger7 +diff --git a/src/pl/plpython/sql/plpython_trigger.sql b/src/pl/plpython/sql/plpython_trigger.sql +index 2a4859f..9727f44 100644 +--- a/src/pl/plpython/sql/plpython_trigger.sql ++++ b/src/pl/plpython/sql/plpython_trigger.sql +@@ -253,7 +253,7 @@ DROP TRIGGER stupid_trigger6 ON trigger_test; + + CREATE FUNCTION stupid7() RETURNS trigger + AS $$ +- TD["new"] = {'a': 'foo', 'b': 'bar'} ++ TD["new"] = {'v': 'foo', 'a': 'bar'} + return "MODIFY"; + $$ LANGUAGE plpythonu; + +@@ -270,7 +270,7 @@ DROP TRIGGER stupid_trigger7 ON trigger_test; + + CREATE FUNCTION stupid7u() RETURNS trigger + AS $$ +- TD["new"] = {u'a': 'foo', u'b': 'bar'} ++ TD["new"] = {u'v': 'foo', u'a': 'bar'} + return "MODIFY" + $$ LANGUAGE plpythonu; + diff --git a/postgresql-var-run-socket.patch b/postgresql-var-run-socket.patch index 5bad691..3174f2e 100644 --- a/postgresql-var-run-socket.patch +++ b/postgresql-var-run-socket.patch @@ -16,29 +16,38 @@ This patch must be applied after postgresql-multi-sockets.patch, at least until 9.3 when that will be part of the upstream package. -diff -Naur postgresql-9.1.4.sockets/contrib/pg_upgrade/server.c postgresql-9.1.4/contrib/pg_upgrade/server.c ---- postgresql-9.1.4.sockets/contrib/pg_upgrade/server.c 2012-05-31 19:07:09.000000000 -0400 -+++ postgresql-9.1.4/contrib/pg_upgrade/server.c 2012-08-12 22:43:10.388873678 -0400 -@@ -179,11 +179,14 @@ - */ - snprintf(cmd, sizeof(cmd), - SYSTEMQUOTE "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" " -- "-o \"-p %d %s\" start >> \"%s\" 2>&1" SYSTEMQUOTE, -+ "-o \"-p %d %s %s\" start >> \"%s\" 2>&1" SYSTEMQUOTE, - cluster->bindir, output_filename, cluster->pgdata, cluster->port, - (cluster->controldata.cat_ver >= - BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ? "-b" : - "-c autovacuum=off -c autovacuum_freeze_max_age=2000000000", -+ /* assume 9.1 builds will have newer socket directory */ -+ (GET_MAJOR_VERSION(cluster->major_version) < 901) ? -+ "-c unix_socket_directory=/var/run/postgresql" : "", - output_filename); +diff -Naur postgresql-9.2.0.sockets/contrib/pg_upgrade/test.sh postgresql-9.2.0/contrib/pg_upgrade/test.sh +--- postgresql-9.2.0.sockets/contrib/pg_upgrade/test.sh 2012-09-06 17:26:17.000000000 -0400 ++++ postgresql-9.2.0/contrib/pg_upgrade/test.sh 2012-09-06 18:13:18.178092176 -0400 +@@ -62,10 +62,14 @@ + rm -rf "$logdir" + mkdir "$logdir" - /* -diff -Naur postgresql-9.1.4.sockets/src/backend/utils/misc/guc.c postgresql-9.1.4/src/backend/utils/misc/guc.c ---- postgresql-9.1.4.sockets/src/backend/utils/misc/guc.c 2012-08-12 20:35:22.559682963 -0400 -+++ postgresql-9.1.4/src/backend/utils/misc/guc.c 2012-08-12 20:35:55.071983609 -0400 -@@ -2874,7 +2874,7 @@ ++# we want the Unix sockets in $temp_root ++PGHOST=$temp_root ++export PGHOST ++ + set -x + + $oldbindir/initdb +-$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -w ++$oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "-c unix_socket_directories='$PGHOST'" -w + if "$MAKE" -C "$oldsrc" installcheck; then + pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$? + if [ "$newsrc" != "$oldsrc" ]; then +@@ -108,7 +112,7 @@ + + pg_upgrade -d "${PGDATA}.old" -D "${PGDATA}" -b "$oldbindir" -B "$bindir" + +-pg_ctl start -l "$logdir/postmaster2.log" -w ++pg_ctl start -l "$logdir/postmaster2.log" -o "-c unix_socket_directories='$PGHOST'" -w + + if [ $testhost = Msys ] ; then + cmd /c analyze_new_cluster.bat +diff -Naur postgresql-9.2.0.sockets/src/backend/utils/misc/guc.c postgresql-9.2.0/src/backend/utils/misc/guc.c +--- postgresql-9.2.0.sockets/src/backend/utils/misc/guc.c 2012-09-06 18:12:36.458693394 -0400 ++++ postgresql-9.2.0/src/backend/utils/misc/guc.c 2012-09-06 18:13:18.181092327 -0400 +@@ -2901,7 +2901,7 @@ }, &Unix_socket_directories, #ifdef HAVE_UNIX_SOCKETS @@ -47,10 +56,10 @@ diff -Naur postgresql-9.1.4.sockets/src/backend/utils/misc/guc.c postgresql-9.1. #else "", #endif -diff -Naur postgresql-9.1.4.sockets/src/bin/initdb/initdb.c postgresql-9.1.4/src/bin/initdb/initdb.c ---- postgresql-9.1.4.sockets/src/bin/initdb/initdb.c 2012-08-12 20:35:22.561682693 -0400 -+++ postgresql-9.1.4/src/bin/initdb/initdb.c 2012-08-12 20:35:55.073983799 -0400 -@@ -970,7 +970,7 @@ +diff -Naur postgresql-9.2.0.sockets/src/bin/initdb/initdb.c postgresql-9.2.0/src/bin/initdb/initdb.c +--- postgresql-9.2.0.sockets/src/bin/initdb/initdb.c 2012-09-06 18:12:36.460693488 -0400 ++++ postgresql-9.2.0/src/bin/initdb/initdb.c 2012-09-06 18:13:18.183092471 -0400 +@@ -1003,7 +1003,7 @@ #ifdef HAVE_UNIX_SOCKETS snprintf(repltok, sizeof(repltok), "#unix_socket_directories = '%s'", @@ -59,10 +68,10 @@ diff -Naur postgresql-9.1.4.sockets/src/bin/initdb/initdb.c postgresql-9.1.4/src #else snprintf(repltok, sizeof(repltok), "#unix_socket_directories = ''"); #endif -diff -Naur postgresql-9.1.4.sockets/src/include/pg_config_manual.h postgresql-9.1.4/src/include/pg_config_manual.h ---- postgresql-9.1.4.sockets/src/include/pg_config_manual.h 2012-05-31 19:07:09.000000000 -0400 -+++ postgresql-9.1.4/src/include/pg_config_manual.h 2012-08-12 20:35:55.073983799 -0400 -@@ -141,7 +141,7 @@ +diff -Naur postgresql-9.2.0.sockets/src/include/pg_config_manual.h postgresql-9.2.0/src/include/pg_config_manual.h +--- postgresql-9.2.0.sockets/src/include/pg_config_manual.h 2012-09-06 17:26:17.000000000 -0400 ++++ postgresql-9.2.0/src/include/pg_config_manual.h 2012-09-06 18:13:18.183092471 -0400 +@@ -144,7 +144,7 @@ * here's where to twiddle it. You can also override this at runtime * with the postmaster's -k switch. */ @@ -71,10 +80,10 @@ diff -Naur postgresql-9.1.4.sockets/src/include/pg_config_manual.h postgresql-9. /* * The random() function is expected to yield values between 0 and -diff -Naur postgresql-9.1.4.sockets/src/test/regress/pg_regress.c postgresql-9.1.4/src/test/regress/pg_regress.c ---- postgresql-9.1.4.sockets/src/test/regress/pg_regress.c 2012-05-31 19:07:09.000000000 -0400 -+++ postgresql-9.1.4/src/test/regress/pg_regress.c 2012-08-12 20:38:43.933609334 -0400 -@@ -781,7 +781,7 @@ +diff -Naur postgresql-9.2.0.sockets/src/test/regress/pg_regress.c postgresql-9.2.0/src/test/regress/pg_regress.c +--- postgresql-9.2.0.sockets/src/test/regress/pg_regress.c 2012-09-06 17:26:17.000000000 -0400 ++++ postgresql-9.2.0/src/test/regress/pg_regress.c 2012-09-06 18:13:18.184092537 -0400 +@@ -772,7 +772,7 @@ if (hostname != NULL) doputenv("PGHOST", hostname); else @@ -83,7 +92,7 @@ diff -Naur postgresql-9.1.4.sockets/src/test/regress/pg_regress.c postgresql-9.1 unsetenv("PGHOSTADDR"); if (port != -1) { -@@ -2240,7 +2240,7 @@ +@@ -2233,7 +2233,7 @@ */ header(_("starting postmaster")); snprintf(buf, sizeof(buf), diff --git a/postgresql.spec b/postgresql.spec index 524d81c..62ce352 100644 --- a/postgresql.spec +++ b/postgresql.spec @@ -35,6 +35,7 @@ %{!?test:%global test 1} %{!?upgrade:%global upgrade 1} %{!?plpython:%global plpython 1} +%{!?plpython3:%global plpython3 1} %{!?pltcl:%global pltcl 1} %{!?plperl:%global plperl 1} %{!?ssl:%global ssl 1} @@ -51,9 +52,9 @@ Summary: PostgreSQL client programs Name: postgresql -%global majorversion 9.1 -Version: 9.1.5 -Release: 2%{?dist} +%global majorversion 9.2 +Version: 9.2.0 +Release: 1%{?dist} # The PostgreSQL license is very similar to other MIT licenses, but the OSI # recognizes it as an independent license, so we do as well. @@ -67,8 +68,8 @@ Url: http://www.postgresql.org/ # This SRPM includes a copy of the previous major release, which is needed for # in-place upgrade of an old database. In most cases it will not be critical # that this be kept up with the latest minor release of the previous series. -%global prevversion 9.0.8 -%global prevmajorversion 9.0 +%global prevversion 9.1.5 +%global prevmajorversion 9.1 Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2 # The PDF file is generated by generate-pdf.sh, which see for comments @@ -93,10 +94,10 @@ Source15: postgresql-bashprofile Patch1: rpm-pgsql.patch Patch2: postgresql-logging.patch Patch3: postgresql-perl-rpath.patch -Patch4: postgresql-oom_score_adj.patch +Patch4: postgresql-config-comment.patch Patch5: postgresql-multi-sockets.patch Patch6: postgresql-var-run-socket.patch -Patch7: postgresql-config-comment.patch +Patch7: postgresql-python3.patch BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk BuildRequires: perl(ExtUtils::Embed), perl-devel @@ -107,6 +108,10 @@ BuildRequires: systemd-units BuildRequires: python-devel %endif +%if %plpython3 +BuildRequires: python3-devel +%endif + %if %pltcl BuildRequires: tcl-devel %endif @@ -265,14 +270,26 @@ Install this if you want to write database functions in Perl. %if %plpython %package plpython -Summary: The Python procedural language for PostgreSQL +Summary: The Python2 procedural language for PostgreSQL Group: Applications/Databases Requires: %{name}-server%{?_isa} = %{version}-%{release} %description plpython The postgresql-plpython package contains the PL/Python procedural language, which is an extension to the PostgreSQL database server. -Install this if you want to write database functions in Python. +Install this if you want to write database functions in Python 2. +%endif + +%if %plpython3 +%package plpython3 +Summary: The Python3 procedural language for PostgreSQL +Group: Applications/Databases +Requires: %{name}-server%{?_isa} = %{version}-%{release} + +%description plpython3 +The postgresql-plpython3 package contains the PL/Python3 procedural language, +which is an extension to the PostgreSQL database server. +Install this if you want to write database functions in Python 3. %endif %if %pltcl @@ -282,7 +299,7 @@ Group: Applications/Databases Requires: %{name}-server%{?_isa} = %{version}-%{release} %description pltcl -The postgresql-plptcl package contains the PL/Tcl procedural language, +The postgresql-pltcl package contains the PL/Tcl procedural language, which is an extension to the PostgreSQL database server. Install this if you want to write database functions in Tcl. %endif @@ -346,6 +363,85 @@ CFLAGS="$CFLAGS -DLINUX_OOM_SCORE_ADJ=0" # CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" ` # %%endif +# plpython requires separate configure/build runs to build against python 2 +# versus python 3. Our strategy is to do the python 3 run first, then make +# distclean and do it again for the "normal" build. Note that the installed +# Makefile.global will reflect the python 2 build, which seems appropriate +# since that's still considered the default plpython version. +%if %plpython3 + +export PYTHON=/usr/bin/python3 + +# These configure options must match main build +%configure --disable-rpath \ +%if %beta + --enable-debug \ + --enable-cassert \ +%endif +%if %plperl + --with-perl \ +%endif +%if %pltcl + --with-tcl \ + --with-tclconfig=%{_libdir} \ +%endif +%if %plpython3 + --with-python \ +%endif +%if %ldap + --with-ldap \ +%endif +%if %ssl + --with-openssl \ +%endif +%if %pam + --with-pam \ +%endif +%if %kerberos + --with-krb5 \ + --with-gssapi \ +%endif +%if %uuid + --with-ossp-uuid \ +%endif +%if %xml + --with-libxml \ + --with-libxslt \ +%endif +%if %nls + --enable-nls \ +%endif +%if %sdt + --enable-dtrace \ +%endif +%if %selinux + --with-selinux \ +%endif + --with-system-tzdata=/usr/share/zoneinfo \ + --datadir=/usr/share/pgsql + +# Fortunately we don't need to build much except plpython itself +cd src/backend +make submake-errcodes +cd ../.. +cd src/pl/plpython +make %{?_smp_mflags} all +cd .. +# save built form in a directory that "make distclean" won't touch +cp -a plpython plpython3 +cd ../.. + +# must also save this version of Makefile.global for later +cp src/Makefile.global src/Makefile.global.python3 + +make distclean + +%endif + +unset PYTHON + +# Normal (not python3) build begins here + %configure --disable-rpath \ %if %beta --enable-debug \ @@ -409,6 +505,24 @@ rm -f src/tutorial/GNUmakefile pushd src/pl make MAX_CONNECTIONS=5 check popd +%if %plpython3 + # must install Makefile.global that selects python3 + mv src/Makefile.global src/Makefile.global.save + cp src/Makefile.global.python3 src/Makefile.global + touch -r src/Makefile.global.save src/Makefile.global + # because "make check" does "make install" on the whole tree, + # we must temporarily install plpython3 as src/pl/plpython, + # since that is the subdirectory src/pl/Makefile knows about + mv src/pl/plpython src/pl/plpython2 + mv src/pl/plpython3 src/pl/plpython + pushd src/pl/plpython + make MAX_CONNECTIONS=5 check + popd + # and clean up our mess + mv src/pl/plpython src/pl/plpython3 + mv src/pl/plpython2 src/pl/plpython + mv -f src/Makefile.global.save src/Makefile.global +%endif pushd contrib make MAX_CONNECTIONS=5 check popd @@ -442,6 +556,16 @@ rm -f src/tutorial/GNUmakefile make DESTDIR=$RPM_BUILD_ROOT install-world +%if %plpython3 + mv src/Makefile.global src/Makefile.global.save + cp src/Makefile.global.python3 src/Makefile.global + touch -r src/Makefile.global.save src/Makefile.global + pushd src/pl/plpython3 + make DESTDIR=$RPM_BUILD_ROOT install + popd + mv -f src/Makefile.global.save src/Makefile.global +%endif + # multilib header hack; note pg_config.h is installed in two places! # we only apply this to known Red Hat multilib arches, per bug #177564 case `uname -i` in @@ -522,6 +646,7 @@ install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile rm bin/dropuser rm bin/ecpg rm bin/initdb + rm bin/pg_basebackup rm bin/pg_config rm bin/pg_controldata rm bin/pg_dump @@ -568,7 +693,6 @@ install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile %endif # Fix some more documentation -# gzip doc/internals.ps cp %{SOURCE8} README.rpm-dist mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql @@ -578,6 +702,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a %if !%upgrade rm -f $RPM_BUILD_ROOT%{_bindir}/pg_upgrade rm -f $RPM_BUILD_ROOT%{_libdir}/pgsql/pg_upgrade_support.so +rm -f $RPM_BUILD_ROOT%{_mandir}/man1/pg_upgrade.* %endif # initialize file lists @@ -588,6 +713,7 @@ cp /dev/null devel.lst cp /dev/null plperl.lst cp /dev/null pltcl.lst cp /dev/null plpython.lst +cp /dev/null plpython3.lst %if %nls %find_lang ecpg-%{majorversion} @@ -622,6 +748,11 @@ cat plpgsql-%{majorversion}.lang >>server.lst %find_lang plpython-%{majorversion} cat plpython-%{majorversion}.lang >>plpython.lst %endif +%if %plpython3 +# plpython3 shares message files with plpython +%find_lang plpython-%{majorversion} +cat plpython-%{majorversion}.lang >>plpython3.lst +%endif %if %pltcl %find_lang pltcl-%{majorversion} cat pltcl-%{majorversion}.lang >>pltcl.lst @@ -746,6 +877,7 @@ fi %{_datadir}/pgsql/extension/refint* %{_datadir}/pgsql/extension/seg* %{_datadir}/pgsql/extension/tablefunc* +%{_datadir}/pgsql/extension/tcn* %{_datadir}/pgsql/extension/test_parser* %{_datadir}/pgsql/extension/timetravel* %{_datadir}/pgsql/extension/tsearch2* @@ -785,6 +917,7 @@ fi %{_libdir}/pgsql/refint.so %{_libdir}/pgsql/seg.so %{_libdir}/pgsql/tablefunc.so +%{_libdir}/pgsql/tcn.so %{_libdir}/pgsql/test_parser.so %{_libdir}/pgsql/timetravel.so %{_libdir}/pgsql/tsearch2.so @@ -809,8 +942,16 @@ fi %{_bindir}/pg_archivecleanup %{_bindir}/pg_standby %{_bindir}/pg_test_fsync +%{_bindir}/pg_test_timing %{_bindir}/pgbench %{_bindir}/vacuumlo +%{_mandir}/man1/oid2name.* +%{_mandir}/man1/pg_archivecleanup.* +%{_mandir}/man1/pg_standby.* +%{_mandir}/man1/pg_test_fsync.* +%{_mandir}/man1/pg_test_timing.* +%{_mandir}/man1/pgbench.* +%{_mandir}/man1/vacuumlo.* %{_mandir}/man3/dblink* %doc contrib/spi/*.example @@ -832,6 +973,7 @@ fi %{_bindir}/pg_basebackup %{_bindir}/pg_controldata %{_bindir}/pg_ctl +%{_bindir}/pg_receivexlog %{_bindir}/pg_resetxlog %{_bindir}/postgres %{_bindir}/postmaster @@ -841,6 +983,7 @@ fi %{_mandir}/man1/pg_basebackup.* %{_mandir}/man1/pg_controldata.* %{_mandir}/man1/pg_ctl.* +%{_mandir}/man1/pg_receivexlog.* %{_mandir}/man1/pg_resetxlog.* %{_mandir}/man1/postgres.* %{_mandir}/man1/postmaster.* @@ -887,6 +1030,7 @@ fi %{_bindir}/pg_upgrade %{_libdir}/pgsql/pg_upgrade_support.so %{_libdir}/pgsql/postgresql-%{prevmajorversion} +%{_mandir}/man1/pg_upgrade.* %endif %if %plperl @@ -907,10 +1051,17 @@ fi %if %plpython %files plpython -f plpython.lst -%{_datadir}/pgsql/extension/plpython* +%{_datadir}/pgsql/extension/plpythonu* +%{_datadir}/pgsql/extension/plpython2* %{_libdir}/pgsql/plpython2.so %endif +%if %plpython3 +%files plpython3 -f plpython3.lst +%{_datadir}/pgsql/extension/plpython3* +%{_libdir}/pgsql/plpython3.so +%endif + %if %test %files test %defattr(-,postgres,postgres) @@ -919,6 +1070,11 @@ fi %endif %changelog +* Mon Sep 10 2012 Tom Lane 9.2.0-1 +- Update to PostgreSQL 9.2.0 (major version bump); + in-place upgrade support now works from 9.1.x as the previous version +- Add postgresql-plpython3 subpackage with PL/Python built against Python 3 + * Tue Aug 28 2012 Tom Lane 9.1.5-2 - Remove unnecessary ldconfig calls in pre/post triggers Resolves: #849344 diff --git a/sources b/sources index bf53086..edb3857 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ +8c4c32a4abe8cf61b02c8366181ede50 postgresql-9.2.0.tar.bz2 +38951718e05922310a0397e2dcbf9330 postgresql-9.2.0-US.pdf c784decb60615aa94c6a31601bc6ffd2 postgresql-9.1.5.tar.bz2 -c497cce8d81a733200584e653c9177f5 postgresql-9.1.5-US.pdf -0e830b0f6538e04b788c3208060256ef postgresql-9.0.8.tar.bz2