--- postgresql-8.1-8.1.4.orig/postgresql-8.1.4.tar.bz2.cdbs-config_list +++ postgresql-8.1-8.1.4/postgresql-8.1.4.tar.bz2.cdbs-config_list @@ -0,0 +1,4 @@ +postgresql-8.1.4/contrib/tsearch2/gendict/config.sh +postgresql-8.1.4/config/config.guess +postgresql-8.1.4/config/config.sub +postgresql-8.1.4/doc/src/sgml/config.sgml --- postgresql-8.1-8.1.4.orig/debian/libpq-dev.links +++ postgresql-8.1-8.1.4/debian/libpq-dev.links @@ -0,0 +1 @@ +/usr/lib/postgresql/8.1/bin/pg_config /usr/bin/pg_config --- postgresql-8.1-8.1.4.orig/debian/libpgtypes2.install +++ postgresql-8.1-8.1.4/debian/libpgtypes2.install @@ -0,0 +1 @@ +usr/lib/libpgtypes.so.2* --- postgresql-8.1-8.1.4.orig/debian/control +++ postgresql-8.1-8.1.4/debian/control @@ -0,0 +1,241 @@ +Source: postgresql-8.1 +Section: misc +Priority: optional +Maintainer: Martin Pitt +Uploaders: Oliver Elphick +Standards-Version: 3.7.2 +XS-Python-Version: current +Build-Depends: debhelper (>= 5.0.37.2), cdbs (>= 0.4.43), bison, perl (>= 5.8), libperl-dev, tk8.4-dev, flex, libreadline5-dev (>= 4.2), libssl-dev, zlib1g-dev | libz-dev, libpam0g-dev | libpam-dev, libxml2-dev, libkrb5-dev, libxslt1-dev, python-dev, python-central (>= 0.5), gettext, bzip2 + +Package: libpq-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, libpq4 (= ${Source-Version}), libssl-dev, libkrb5-dev, comerr-dev +Conflicts: postgresql-dev (<< 7.5) +Replaces: postgresql-dev +Suggests: postgresql-doc-8.1 +Description: header files for libpq4 (PostgreSQL library) + Header files and static library for compiling C programs to link + with the libpq library in order to communicate with a PostgreSQL + database backend. + . + PostgreSQL is an object-relational SQL database management system. + +Package: libpq4 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Description: PostgreSQL C client library + libpq is a C library that enables user programs to communicate with + the PostgreSQL database server. The server can be on another machine + and accessed through TCP/IP. This version of libpq is compatible + with servers from PostgreSQL 7.3 to 8.1. + . + This package contains the run-time library, needed by packages using + libpq. + . + PostgreSQL is an object-relational SQL database management system. + +Package: libecpg5 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Description: run-time library for ECPG programs + The libecpg shared library is used by programs built with ECPG + (Embedded PostgreSQL for C). + . + PostgreSQL is an object-relational SQL database management system. + +Package: libecpg-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, libpq-dev, libecpg-compat2, libpgtypes2 +Conflicts: postgresql-dev, libecpg3-dev +Description: development files for ECPG (Embedded PostgreSQL for C) + This package contains the necessary files to build ECPG (Embedded + PostgreSQL for C) programs. It includes the development libraries + and the preprocessor program ecpg. + . + PostgreSQL is an object-relational SQL database management system. + . + Install this package if you want to write C programs with SQL statements + embedded in them (rather than run by an external process). + +Package: libecpg-compat2 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Description: older version of run-time library for ECPG programs + The libecpg_compat shared library is used by programs built with ecpg. + (Embedded PostgreSQL for C). + . + PostgreSQL is an object-relational SQL database management system. + +Package: libpgtypes2 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Description: shared library libpgtypes for PostgreSQL 8.1 + The libpgtypes shared library is used by programs built with ecpg. + (Embedded PostgreSQL for C). + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-8.1 +Architecture: any +Section: misc +Depends: ${shlibs:Depends}, postgresql-client-8.1, postgresql-common (>= 39) +Suggests: oidentd | ident-server +Conflicts: postgresql (<< 7.5) +Description: object-relational SQL database, version 8.1 server + PostgreSQL is a fully featured object-relational database management + system. It supports a large part of the SQL standard and is designed + to be extensible by users in many aspects. Some of the features are: + ACID transactions, foreign keys, views, sequences, subqueries, + triggers, user-defined types and functions, outer joins, multiversion + concurrency control. Graphical user interfaces and bindings for many + programming languages are available as well. + . + This package provides the database server for PostgreSQL 8.1. Servers + for other major release versions can be installed simultaneously and + are coordinated by the postgresql-common package. A package providing + ident-server is needed if you want to authenticate remote connections + with identd. + +Package: postgresql-client-8.1 +Architecture: any +Section: misc +Depends: ${shlibs:Depends}, postgresql-client-common +Conflicts: postgresql (<< 7.5) +Suggests: postgresql-8.1, postgresql-doc-8.1 +Description: front-end programs for PostgreSQL 8.1 + This package contains client and administrative programs for + PostgreSQL: these are the interactive terminal client psql and + programs for creating and removing users and databases. + . + This is the client package for PostgreSQL 8.1. If you install + PostgreSQL 8.1 on a standalone machine, you need the server package + postgresql-8.1, too. On a network, you can install this package on + many client machines, while the server package may be installed on + only one machine. + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-server-dev-8.1 +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, libpq-dev (>= 8.1) +Conflicts: pgxs +Replaces: pgxs +Description: development files for PostgreSQL 8.1 server-side programming + Header files for compiling SSI code to link into PostgreSQL's backend; for + example, for C functions to be called from SQL. + . + This package also contains the Makefiles necessary for building add-on + modules of PostgreSQL, which would otherwise have to be built in the + PostgreSQL source-code tree. + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-doc-8.1 +Architecture: all +Section: doc +Suggests: doc-linux-html,pgdocs +Conflicts: postgresql-doc (<< 7.5) +Description: documentation for the PostgreSQL database management system + This package contains all README files, user manual, and examples for + PostgreSQL 8.1. The manual is in HTML format. See the + packages pgdocs-pdf and pgdocs-pdf-a4 for other printable formats. + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-contrib-8.1 +Architecture: any +Section: misc +Depends: postgresql-8.1, ${shlibs:Depends}, postgresql-common (>= 39) +Recommends: libpg-perl (>= 1:2.0.1-1), libdbd-pg-perl +Conflicts: postgresql-contrib (<< 7.5) +Description: additional facilities for PostgreSQL + The PostgreSQL contrib package provides several additional features + for the PostgreSQL database. This version is built to work with the + server package postgresql-8.1. contrib often serves as a testbed for + features before they are adopted into PostgreSQL proper: + . + btree_gist - B-Tree indexing using GiST (Generalised Search Tree) + chkpass - Password type for storing and comparing encrypted passwords + cube - Type for n-dimensional "cubes" + dbf2pg - Inserts the contents of an xBase-style .dbf file into a + PostgreSQL table + dblink - Functions to return results from a remote database + dbmirror - Trigger-based databaase mirroring + earthdistance - Operator for computing the distance (in miles) between + two points on the earth's surface + fti - Full text indexing using triggers + fuzzystrmatch - Functions for fuzzy string comparison (including Soundex) + intagg - Integer aggregator/enumerator + intarray - RD-tree data structure using GiST index + isbn_issn - Type extensions for ISBN (books) and ISSN (serials) + lo - Large Object maintenance + ltree - data types, indexed access methods and queries for data + organized as a tree-like structures. + oid2name - Maps oids to table names + ora2pg - Conversion utility for Oracle database schemas + pg_buffercache - Real time queries on the shared buffer cache + pg_trgm - Determine the similarity of text based on trigram matching + pgbench - A simple program to run a benchmark test + pgcrypto - Cryptographic functions + pgstattuple - Returns the percentage of dead tuples in a table; this + indicates whether a vacuum is required. + seg - Type representing laboratory measurements as floating- + point intervals + spi - PostgreSQL Server Programming Interface; 4 examples of + its use: + autoinc - A function for implementing AUTOINCREMENT/ + IDENTITY + insert_username - function for inserting user names + moddatetime - Update modification timestamps + refint - Functions for implementing referential + integrity (foreign keys). Note that this is + now superseded by built-in referential + integrity. + timetravel - Re-implements in user code the time travel + feature that was removed in 6.3. + tips - Micro HOWTOs + tsearch2 - Searchable text data type supporting indexed access + user_locks - User-level long-term locks + vacuumlo - Vacuum deleted large objects + xml2 - Manipulate XML documents in the database + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-plperl-8.1 +Architecture: any +Depends: ${shlibs:Depends}, postgresql-8.1 +Description: PL/Perl procedural language for PostgreSQL 8.1 + PL/Perl enables an SQL developer to write procedural language functions + for PostgreSQL 8.1 in Perl. You need this package if you have any + PostgreSQL 8.1 functions that use the languages plperl or plperlu. + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-plpython-8.1 +Architecture: any +Depends: ${shlibs:Depends}, postgresql-8.1 +XB-Python-Version: ${python:Versions} +Description: PL/Python procedural language for PostgreSQL 8.1 + PL/Python enables an SQL developer to write procedural language functions + for PostgreSQL 8.1 in Python. You need this package if you have any + PostgreSQL 8.1 functions that use the languages plpython or plpythonu. + . + PostgreSQL is an object-relational SQL database management system. + +Package: postgresql-pltcl-8.1 +Architecture: any +Depends: ${shlibs:Depends}, postgresql-8.1 +Description: PL/TCL procedural language for PostgreSQL 8.1 + PL/TCL enables an SQL developer to write procedural language functions + for PostgreSQL 8.1 in TCL. You need this package if you have any + PostgreSQL 8.1 functions that use the languages pltcl or pltclu. + . + PostgreSQL is an object-relational SQL database management system. + --- postgresql-8.1-8.1.4.orig/debian/postgresql-client-8.1.prerm +++ postgresql-8.1-8.1.4/debian/postgresql-client-8.1.prerm @@ -0,0 +1,10 @@ +#!/bin/sh -e + +#DEBHELPER# + +VERSION=8.1 + +if [ "$1" = remove ]; then + . /usr/share/postgresql-common/maintscripts-functions + remove_client_version $VERSION +fi --- postgresql-8.1-8.1.4.orig/debian/rules +++ postgresql-8.1-8.1.4/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +TCL_VER := 8.4 +DEB_TAR_SRCDIR := postgresql-8.1.4 + +include /usr/share/cdbs/1/rules/tarball.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/debhelper.mk + +LDFLAGS+= -Wl,--as-needed +CFLAGS+= -fPIC + +DEB_DH_INSTALL_SOURCEDIR=debian/tmp +DEB_CONFIGURE_EXTRA_FLAGS := --mandir=\$${prefix}/share/postgresql/8.1/man \ + --with-docdir=\$${prefix}/share/doc/postgresql-doc-8.1 \ + --datadir=\$${prefix}/share/postgresql/8.1 \ + --bindir=\$${prefix}/lib/postgresql/8.1/bin \ + --includedir=\$${prefix}/include/postgresql/ \ + --enable-nls \ + --enable-integer-datetimes \ + --enable-thread-safety \ + --enable-debug \ + --disable-rpath \ + --with-tcl \ + --with-perl \ + --with-python \ + --with-pam \ + --with-krb5 \ + --with-openssl \ + --with-gnu-ld \ + --with-tclconfig=/usr/lib/tcl$(TCL_VER) \ + --with-tkconfig=/usr/lib/tk$(TCL_VER) \ + --with-includes=/usr/include/tcl$(TCL_VER) \ + --with-pgport=5432 \ + $(ARCH_OPTS) \ + CFLAGS='$(CFLAGS)' \ + LDFLAGS='$(LDFLAGS)' + +DEB_DH_MAKESHLIBS_ARGS := -Xusr/lib/postgresql/8.1 +DEB_DH_INSTALLCHANGELOGS_ARGS := build-tree/postgresql-*/HISTORY +DEB_COMPRESS_EXCLUDE := .source .c +DEB_DH_INSTALLINIT_ARGS := -u'defaults 19' + +common-post-build-arch:: + # generate POT files for translators + find build-tree -name nls.mk -exec sh -c "make -C \$$(dirname {}) init-po" \; + +common-post-build-indep:: + # build tutorial stuff + make -C build-tree/$(DEB_TAR_SRCDIR)/src/tutorial NO_PGXS=1 + +install/postgresql-doc-8.1:: + install build-tree/$(DEB_TAR_SRCDIR)/src/tutorial/*.c build-tree/$(DEB_TAR_SRCDIR)/src/tutorial/*.source build-tree/$(DEB_TAR_SRCDIR)/src/tutorial/Makefile build-tree/$(DEB_TAR_SRCDIR)/src/tutorial/README debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/tutorial + +binary-predeb/postgresql-8.1:: + # patch away the "don't execute as root" check for the test + # suite; doing it here will ensure that the actual debs have + # the check. + cd build-tree/$(DEB_TAR_SRCDIR) && \ + patch -p1 < ../../debian/disable-root-check.patch && \ + make + + # run testsuite +ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS))) + cd build-tree/$(DEB_TAR_SRCDIR); \ + if ! make check; then \ + for l in regression.diffs log/initdb.log log/postmaster.log; do \ + if [ -e src/test/regress/$$l ]; then \ + echo "********* $$l *******"; \ + cat src/test/regress/$$l; \ + fi; \ + done; \ + fi +endif + + cd build-tree/$(DEB_TAR_SRCDIR) && \ + patch -Rp1 < ../../debian/disable-root-check.patch + + # compress manpages + find debian/postgresql-8.1/usr/share/postgresql/8.1/man -type f -exec gzip -9 '{}' \; + +binary-predeb/postgresql-client-8.1:: + find debian/postgresql-client-8.1/usr/share/postgresql/8.1/man -type f -exec gzip -9 '{}' \; + +binary-install/postgresql-plpython-8.1:: + dh_pycentral -p$(cdbs_curpkg) + dh_python -p$(cdbs_curpkg) usr/lib/postgresql/8.1/lib + --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.install @@ -0,0 +1,27 @@ +usr/lib/postgresql/8.1/bin/initdb +usr/lib/postgresql/8.1/bin/ipcclean +usr/lib/postgresql/8.1/bin/pg_controldata +usr/lib/postgresql/8.1/bin/pg_ctl +usr/lib/postgresql/8.1/bin/pg_resetxlog +usr/lib/postgresql/8.1/bin/postgres +usr/lib/postgresql/8.1/bin/postmaster +usr/lib/postgresql/8.1/lib/*_and_*.so +usr/lib/postgresql/8.1/lib/plpgsql.so +usr/share/locale/*/LC_MESSAGES/initdb-8.1.mo +usr/share/locale/*/LC_MESSAGES/pg_controldata-8.1.mo +usr/share/locale/*/LC_MESSAGES/pg_ctl-8.1.mo +usr/share/locale/*/LC_MESSAGES/pg_resetxlog-8.1.mo +usr/share/locale/*/LC_MESSAGES/postgres-8.1.mo +usr/share/postgresql/8.1/man/man1/initdb.1 +usr/share/postgresql/8.1/man/man1/ipcclean.1 +usr/share/postgresql/8.1/man/man1/pg_controldata.1 +usr/share/postgresql/8.1/man/man1/pg_ctl.1 +usr/share/postgresql/8.1/man/man1/pg_resetxlog.1 +usr/share/postgresql/8.1/man/man1/postgres.1 +usr/share/postgresql/8.1/man/man1/postmaster.1 +usr/share/postgresql/8.1/timezone/* +usr/share/postgresql/8.1/*.sql +usr/share/postgresql/8.1/*.conf.sample +usr/share/postgresql/8.1/postgres.bki +usr/share/postgresql/8.1/postgres.description +usr/share/postgresql/8.1/sql_features.txt --- postgresql-8.1-8.1.4.orig/debian/postgresql-contrib-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-contrib-8.1.install @@ -0,0 +1,38 @@ +usr/share/doc/postgresql-doc-8.1/contrib/* usr/share/doc/postgresql-contrib-8.1 +usr/share/postgresql/8.1/contrib/* +usr/lib/postgresql/8.1/bin/DBMirror.pl +usr/lib/postgresql/8.1/bin/clean_pending.pl +usr/lib/postgresql/8.1/bin/dbf2pg +usr/lib/postgresql/8.1/bin/fti.pl +usr/lib/postgresql/8.1/bin/oid2name +usr/lib/postgresql/8.1/bin/pgbench +usr/lib/postgresql/8.1/lib/_int.so +usr/lib/postgresql/8.1/lib/autoinc.so +usr/lib/postgresql/8.1/lib/btree_gist.so +usr/lib/postgresql/8.1/lib/chkpass.so +usr/lib/postgresql/8.1/lib/cube.so +usr/lib/postgresql/8.1/lib/dblink.so +usr/lib/postgresql/8.1/lib/earthdistance.so +usr/lib/postgresql/8.1/lib/fti.so +usr/lib/postgresql/8.1/lib/fuzzystrmatch.so +usr/lib/postgresql/8.1/lib/insert_username.so +usr/lib/postgresql/8.1/lib/int_aggregate.so +usr/lib/postgresql/8.1/lib/isbn_issn.so +usr/lib/postgresql/8.1/lib/lo.so +usr/lib/postgresql/8.1/lib/ltree.so +usr/lib/postgresql/8.1/lib/moddatetime.so +usr/lib/postgresql/8.1/bin/ora2pg.pl +usr/lib/postgresql/8.1/bin/Ora2Pg.pm usr/share/postgresql/8.1/contrib +usr/lib/postgresql/8.1/lib/pending.so +usr/lib/postgresql/8.1/lib/pg_trgm.so +usr/lib/postgresql/8.1/lib/pgcrypto.so +usr/lib/postgresql/8.1/lib/pgstattuple.so +usr/lib/postgresql/8.1/lib/refint.so +usr/lib/postgresql/8.1/lib/seg.so +usr/lib/postgresql/8.1/lib/tablefunc.so +usr/lib/postgresql/8.1/lib/timetravel.so +usr/lib/postgresql/8.1/lib/tsearch2.so +usr/lib/postgresql/8.1/lib/user_locks.so +usr/lib/postgresql/8.1/lib/pgxml.so +usr/lib/postgresql/8.1/lib/pg_buffercache.so +usr/lib/postgresql/8.1/lib/admin81.so --- postgresql-8.1-8.1.4.orig/debian/postgresql-contrib-8.1.prerm +++ postgresql-8.1-8.1.4/debian/postgresql-contrib-8.1.prerm @@ -0,0 +1,10 @@ +#!/bin/sh -e + +#DEBHELPER# + +VERSION=8.1 + +if [ "$1" = remove ]; then + . /usr/share/postgresql-common/maintscripts-functions + remove_contrib_version $VERSION +fi --- postgresql-8.1-8.1.4.orig/debian/changelog +++ postgresql-8.1-8.1.4/debian/changelog @@ -0,0 +1,710 @@ +postgresql-8.1 (8.1.4-7ubuntu0.3) edgy-security; urgency=low + + * Add debian/patches/00upstream-zzz-sql-fun-typecheck-regression.patch: Fix + overzealous type checks in some cases. Closes: LP#83505 + + -- Martin Pitt Tue, 6 Feb 2007 18:57:15 +0100 + +postgresql-8.1 (8.1.4-7ubuntu0.2) edgy-security; urgency=low + + * SECURITY UPDATE: Read out arbitrary memory locations from the server, + local DoS. + * Add debian/patches/00upstream-sql-fun-typecheck.patch: + - Repair insufficiently careful type checking for SQL-language functions. + Not only can one trivially crash the backend, but with appropriate + misuse of pass-by-reference datatypes it is possible to read out + arbitrary locations in the server process's memory, which could allow + retrieving database content the user should not be able to see. + - Discovered by Jeff Trout. + - Patch backported from 8.1.7 from CVS: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c.diff?r1=1.98.2.2;r2=1.98.2.3 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.201.2.1;r2=1.201.2.2 + - CVE-2007-0555 + * Add debian/patches/00upstream-table-plan-consistency.patch: + - Check that a table is still compatible with a previously made query + plan. Use of ALTER COLUMN TYPE creates a hazard for cached query plans: + they could contain vars that claim a column has a different type than it + now has. Not only can one trivially crash the backend, but with + appropriate misuse of pass-by-reference datatypes it is possible to read + out arbitrary locations in the server process's memory, which could allow + retrieving database content the user should not be able to see. + - Discovered by Jeff Trout. + - Patch backported from 8.1.7 from CVS: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.174.2.3;r2=1.174.2.4 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execQual.c.diff?r1=1.183.2.4;r2=1.183.2.5 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execScan.c.diff?r1=1.37.2.1;r2=1.37.2.2 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c.diff?r1=1.126.2.3;r2=1.126.2.4 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeAgg.c.diff?r1=1.135.2.1;r2=1.135.2.2 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeGroup.c.diff?r1=1.62;r2=1.62.2.1 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHashjoin.c.diff?r1=1.75.2.3;r2=1.75.2.4 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c.diff?r1=1.75.2.2;r2=1.75.2.3 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeNestloop.c.diff?r1=1.39.2.1;r2=1.39.2.2 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeResult.c.diff?r1=1.32.2.1;r2=1.32.2.2 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSubplan.c.diff?r1=1.70.2.1;r2=1.70.2.2 + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h.diff?r1=1.120.2.2;r2=1.120.2.3 + - CVE-2007-0556 + * Add debian/patches/00upstream-max-utf8-wchar-len.patch: + - Update various string functions to support the maximum UTF-8 sequence + length for 4-byte character set to prevent buffer overflows. + - Patch backported from 8.1.7 from CVS: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/wchar.c.diff?r1=1.47.2.4;r2=1.47.2.5 + + -- Martin Pitt Mon, 5 Feb 2007 08:55:40 +0100 + +postgresql-8.1 (8.1.4-7ubuntu0.1) edgy-security; urgency=low + + * SECURITY UPDATE: Local DoS. + * Add debian/patches/00upstream-disable-update-aggregates.patch: + - Disallow aggregate functions in UPDATE commands (unless within a + sub-SELECT). It is disallowed by the SQL spec and causes crashes. + - Patch backported from 8.1.5: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.326.2.1&r2=1.326.2.2 + - CVE-2006-5540 + * Add debian/patches/00upstream-duration-logging-crash.patch: + - Fix crash in duration logging for a V3-protocol Execute message + when what's being executed is a COMMIT or ROLLBACK. + - Patch backported from 8.1.5: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c.diff?r1=1.468.2.5&r2=1.468.2.6 + - CVE-2006-5542 + * Add debian/patches/00upstream-unknown-array-coerce.patch: + - Repair incorrect check for coercion of unknown literal to ANYARRAY, + which could cause a backend crash. + - Patch backported from 8.1.5: + http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_coerce.c.diff?r1=2.132.2.3&r2=2.132.2.4 + - CVE-2006-5541 + + -- Martin Pitt Mon, 23 Oct 2006 18:21:40 +0200 + +postgresql-8.1 (8.1.4-7) unstable; urgency=low + + * debian/control: Update libpq4 package description, point out that it is + only compatible for servers up to 8.1 (8.2 got a new libpq soname). + * Add debian/patches/08-unnecessary-libs.patch: Remove all unnecessary -lfoo + library references from Makefiles to clean up unnecessary library + dependencies. Thanks to Christian Aichinger for his neat checklib system! + + -- Martin Pitt Wed, 27 Sep 2006 22:53:23 +0200 + +postgresql-8.1 (8.1.4-6) unstable; urgency=low + + * debian/control: Drop heimdal-dev suggestion of libpq-dev. Closes: #379848 + * debian/libpq-dev.install: Ship pg_wchar.h. Closes: #380047 + * Transition for private python extension in p-plpython-8.1: + - debian/control: + + Bump cdbs/debhelper build dependency versions. + + Add {XS,XB}-Python-Version attributes. + - debian/compat: Use compat level 5. + - Add debian/pycompat: Use compat level 2. + - debian/rules: Call dh_pycentral and dh_python for p-plpython-8.1. + - Closes: #380898 + * debian/control: Change the order of records so that the libraries come + first. With that, postgresql-client-8.1 and friends pick up the correct + shlibs. Closes: #381211 + + -- Martin Pitt Sun, 6 Aug 2006 12:31:37 +0200 + +postgresql-8.1 (8.1.4-5) unstable; urgency=low + + * debian/rules: Install init script at priority 19, since Apache and web + applications usually reside on priority 20, but often require a running + database. This follows a recent change in the MySQL package, thanks to + Christian Hammers for pointing this out. Closes: #379276 + * Add debian/patches/12-pg_restore-ignore-failing-tables.patch: + - pg_restore: Add option -X no-data-for-failed-tables to ignore TABLE DATA + objects if the corresponding TABLE could not be created. Necessary for + fixing #351571. + + -- Martin Pitt Sun, 23 Jul 2006 10:34:55 +0200 + +postgresql-8.1 (8.1.4-4) unstable; urgency=low + + * debian/rules: Use -fPIC instead of -fpic to avoid FTBFS on sparc and m68k + (and maybe avoid the ICE on arm). + * debian/postgresql-8.1.init: Add LSB magic comment header (provide both + postgresql-8.1 and a generic postgresql service). Closes: #377882 + + -- Martin Pitt Tue, 11 Jul 2006 22:28:07 +0200 + +postgresql-8.1 (8.1.4-3) unstable; urgency=low + + * debian/control: Add missing comerr-dev and libkrb5-dev dependencies to + libpq-dev. Closes: #371158 + * Add debian/patches/54-contrib-dbmirror-quoteparsing.patch: Fix parsing of + quotes escaped as '' in PendingData table. Closes: #375743 + * Add debian/patches/55-contrib-admin.patch: + - Add the 'admin81' contrib module and build it. This provides + instrumentation functions for use with PgAdmin 3 and similar. + - http://www.postgresql.org/ftp/pgadmin3/release/v1.4.2/adminpacks/ + - Closes: #354731 + * debian/rules: Build with -fpic everywhere to improve the proactive + security effectivity of address space layout randomization. This has no + measurable performance impact on at least i386, amd64, and powerpc. + + -- Martin Pitt Fri, 7 Jul 2006 21:28:45 +0200 + +postgresql-8.1 (8.1.4-2) unstable; urgency=medium + + * Add debian/libpq4.shlibs and bump it to >= 8.1.4, to respect the + introduction of PQescapeStringConn() and PQescapeByteaConn(). + * debian/postgresql-8.1.postrm, clean_dir(): Do not use rmdir's + --ignore-fail-on-nonempty, since that still falls apart when the + directory is a mountpoint. Just ignore errors. + + -- Martin Pitt Fri, 2 Jun 2006 00:44:26 +0200 + +postgresql-8.1 (8.1.4-1) unstable; urgency=medium + + * New upstream security and bug fix release: + - The server now rejects invalidly-encoded multibyte characters in all + cases to defend against SQL-injection attacks. [CVE-2006-2313] + - Reject unsafe uses of \' in string literals (for client encodings that + allow SQL injection with this, like SJIS, BIG5, GBK, GB18030, or UHC). A + new configuration parameter backslash_quote is available to adjust this + behavior when needed. [CVE-2006-2314] + - Modify libpq's string-escaping routines to be aware of encoding + considerations and standard_conforming_strings + This fixes libpq-using applications for the security issues + described in CVE-2006-2313 and CVE-2006-2314, and also + future-proofs them against the planned changeover to SQL-standard + string literal syntax. Applications that use multiple PostgreSQL + connections concurrently should migrate to PQescapeStringConn() and + PQescapeByteaConn() to ensure that escaping is done correctly for + the settings in use in each database connection. Applications that + do string escaping "by hand" should be modified to rely on library + routines instead. + - Various bug fixes, see upstream changelog for details. + * Remove debian/patches/12-krb5-multiusers.patch: Fixed upstream. + * debian/postgresql-8.1.init: Add a comment to point out that environment + variables need to be set in the 'environment' file, not in the init + script. + * debian/postgresql-8.1.init, debian/postgresql-8.1.postinst: Do not fail if + init.d-functions/maintscripts-functions are not present, which happens if + postgresql-{8.1,common} are removed, but not purged. Closes: #362488 + * Bump Standards-Version to 3.7.2. + + -- Martin Pitt Mon, 22 May 2006 10:33:20 +0200 + +postgresql-8.1 (8.1.3-4) unstable; urgency=low + + * debian/rules: + - Put --as-needed into LDFLAGS instead of CFLAGS to avoid warnings when + building extension modules. Closes: #360759 + - Fix a bashism. + * debian/control: Suggest oidentd | ident-server (oidentd prefered since it + works with IPv6). Closes: #359193 + * libecpg-dev: Move manpage to /usr/share/man/man1 where it belongs to. + Closes: #360817 + * debian/rules: Ship the tutorial's Makefile and ship the SQL *.source files + (not the generated *.sql files) to get the correct path to the built + libraries. Closes: #360469 + * Add debian/patches/13-tutorial-README.patch: Remove confusing note about + make and point out that p-server-dev-8.1 is required for building the + tutorial. + * debian/postgresql-contrib-8.1.install, 50-contrib-oracle-enable.patch: + Move Ora2Pg.pm to /usr/share/postgresql/8.1 and adapt the library search + path in ora2pg.pl accordingly. Closes: #360818 + + -- Martin Pitt Mon, 10 Apr 2006 22:43:11 +0200 + +postgresql-8.1 (8.1.3-3) unstable; urgency=low + + * debian/postgresql-8.1.init: Use shell 'sh -e' instead of bash. + * debian/postgresql-contrib-8.1.install: Ship ora2pg.pl and Ora2Pg.pm. + * debian/control: Updated contrib package description. Closes: #355172 + * debian/rules: Don't special-case HPPA for --enable-thread-safety-force; + the current kernel seems to cope with threads quite well, so that the + configure check does not hang any more. Closes: #315440 + * debian/control: Build server packages on mips and mipsel again, even if + they do not work. No need to block testing migration forever (the + ftp-masters seem reluctant to remove the mips binaries, see #344487), and + the bug is in binutils, not PostgreSQL itself (see #357603). + + -- Martin Pitt Sat, 1 Apr 2006 22:13:03 +0200 + +postgresql-8.1 (8.1.3-2) unstable; urgency=low + + * Re-enable 'do not run as root' check from upstream: + - Move debian/patches/08-disable-root-check.patch to + debian/disable-root-check.patch. + - debian/rules: Move test suite to binary/predeb and apply + disable-root-check.patch manually right before calling the test suite. + Unapply debian/disable-root-check.patch after executing the + test suite to not break subsequent package builds. + - With this, the test suite can happily run as (fake)root during package + build without disabling the check in the actual packages. + * postgresql-doc-8.1: Ship tutorial C and SQL files. + (https://launchpad.net/bugs/30233) + * debian/control, postgresql-client-8.1: Depend on postgresql-client-common + instead of postgresql-common. + + -- Martin Pitt Sat, 18 Mar 2006 15:21:27 +0100 + +postgresql-8.1 (8.1.3-1) unstable; urgency=low + + * New upstream security and bug fix release: + - Fix bug that allowed any logged-in user to "SET ROLE" to any other + database user id (CVE-2006-0553). + - See upstream changelog for detailled changes. + * Remove debian/patches/80-cvs-pg_restore-COPY.patch: Upstream now. + * debian/rules: Use --as-needed linker option to avoid excessive + library dependencies. + * debian/control: Remove unnecessary dependencies from PL/Python and PL/Tcl + packages. + + -- Martin Pitt Tue, 14 Feb 2006 17:46:31 +0100 + +postgresql-8.1 (8.1.2-2) unstable; urgency=low + + * debian/patches/09-relax-sslkey-permscheck.patch: Do not check for any + particular group if the SSL key is group readable, to allow sharing a + common SSL certificate with other server processes. + * debian/control: Add ${shlibs:Depends} to packages which need it. + Closes: #348066 + * debian/control, libecpg5: Remove obsolete Provides/Conflicts to ecpg. + * Add debian/patches/80-cvs-pg_restore-COPY.patch: + - Fix pg_restore to properly discard COPY data when trying to continue + after an error in a COPY statement. Formerly it thought the COPY data + was SQL commands, and got quite confused. + - Patch from Stephen Frost, taken from upstream CVS. + * Add debian/patches/12-krb5-multiusers.patch: + - Fix krb5 credential handling in libpq for multiple connections with + different users: Don't keep credentials in global variables, but pass + them around in a new krb5_info struct. + - Patch from Stephen Frost, proposed to be adopted upstream. + + -- Martin Pitt Mon, 6 Feb 2006 21:07:31 +0100 + +postgresql-8.1 (8.1.2-1) unstable; urgency=medium + + * New upstream bugfix release: + - Fix bug introduced in 8.0 that could allow ReadBuffer to return an + already-used page as new, potentially causing loss of recently-committed + data. + - Fix for protocol-level Describe messages issued outside a + transaction or in a failed transaction. + - Fix character string comparison for locales that consider different + character combinations as equal, such as Hungarian. + This might require "REINDEX" to fix existing indexes on textual + columns. + - Set locale environment variables during postmaster startup to + ensure that plperl won't change the locale later. This fixes a problem + that occurred if the postmaster was started + with environment variables specifying a different locale than what + initdb had been told. Under these conditions, any use of plperl was + likely to lead to corrupt indexes. You may need "REINDEX" to fix + existing indexes on textual columns if this has happened to you. + (postgresql-common checks and aborts on this condition.) + - Allow more flexible relocation of installation directories. + Previous releases supported relocation only if all installation + directory paths were the same except for the last component. + This makes the test suite work with Debian's directory structure, so + that the horology test can find the timezones again and pass. + - Prevent crashes caused by the use of ISO-8859-5 and ISO-8859-9 + encodings. + - Fix longstanding bug in strpos() and regular expression handling in + certain rarely used Asian multi-byte character sets. + - Fix bug where COPY CSV mode considered any \. to terminate the copy + data. The new code requires \. to appear alone on a line, as per + documentation. + - Make COPY CSV mode quote a literal data value of \. to ensure it + cannot be interpreted as the end-of-data marker. + - Various fixes for functions returning RECORDs. + - Fix processing of "postgresql.conf" so a final line with no newline + is processed properly. + - Fix bug in "/contrib/pgcrypto" gen_salt, which caused it not to use + all available salt space for MD5 and XDES algorithms. Salts for + Blowfish and standard DES are unaffected. + - Fix autovacuum crash when processing expression indexes. + - Fix "/contrib/dblink" to throw an error, rather than crashing, when + the number of columns specified is different from what's actually + returned by the query. + * Remove debian/patches/12-readline-prompt-ignore.patch: Adopted upstream. + * Bump postgresql-common dependencies to >= 39. This will ensure more + robust upgrades and other bug fixes. + + -- Martin Pitt Mon, 9 Jan 2006 18:34:31 +0100 + +postgresql-8.1 (8.1.1-2) unstable; urgency=low + + * Do not build postgresql-8.1, p-contrib-8.1, and the PL/ packages on mips + and mipsel, since the postmaster just SIGBUSes on these architectures and + nobody seems to be able to fix that. + * Add debian/patches/12-readline-prompt-ignore.patch: Do not prepend a + '\001' before the 'prompt ignore begin/end' readline commands; this is a + bash quirk, not a readline feature. Thanks to Aaron Schrab. + Closes: #343616 + + -- Martin Pitt Thu, 22 Dec 2005 19:13:21 +0100 + +postgresql-8.1 (8.1.1-1) unstable; urgency=low + + * New upstream bug fix release. + * Remove debian/patches/80_cvs_crash_deform_tuple.patch, upstream now. + * debian/postgresql-8.1.postrm: Also clean start.conf if purging without + pg_dropcluster. + * debian/postgresql-8.1.postrm: Check if a /etc/postgresql/8.1 subdirectory + is really a cluster directory before trying to remove it. Closes: #339810 + * Ship upstream changelog. + + -- Martin Pitt Mon, 12 Dec 2005 17:27:57 +0100 + +postgresql-8.1 (8.1.0-3) unstable; urgency=low + + * debian/rules: Remove superfluous R include path. + * debian/control: Version the libpq-dev dependency of -server-dev-8.1 to + avoid horrible breakage. + * Add debian/patches/80_cvs_crash_deform_tuple.patch: + - Fix crash in tuple deformator (stolen from CVS head). + - Closes: #339527 + * Add debian/patches/52-contrib-dbase-enable-iconv.patch: + - Enable iconv support for 'dbf2pg' contrib module. + - Closes: #338645 + + -- Martin Pitt Sun, 20 Nov 2005 17:01:53 +0100 + +postgresql-8.1 (8.1.0-2) unstable; urgency=low + + * Do not install pg_config and its mo files into postgresql-server-dev-8.1 + any more, since libpq-dev now ships it. Closes: #338231 + * debian/control: Clean up contrib description. Closes: #338308 + + -- Martin Pitt Wed, 9 Nov 2005 20:29:16 -0500 + +postgresql-8.1 (8.1.0-1) unstable; urgency=low + + * Final 8.1.0 upstream release, first unstable upload. + * Build client libraries (-8.0 does not build them any more). + * Add debian/patches/11-server-includedir.patch: Change server include + directory to /usr/include/postgresql/8.1/server since we do want to + keep apart server include files. + + -- Martin Pitt Sat, 5 Nov 2005 18:57:00 -0500 + +postgresql-8.1 (8.0+8.1rc1-1) experimental; urgency=low + + * Upgrade to 8.1rc1 release. + + -- Martin Pitt Mon, 31 Oct 2005 17:43:19 -0500 + +postgresql-8.1 (8.0+8.1beta4-2) experimental; urgency=low + + * Clean up the installation path ./configure arguments. + - debian/rules: Use default libdir /usr/lib. + - Add debian/patches/10-pkglibdir.patch: Set pkglibdir to + /usr/lib/postgresql/8.1/lib instead of /usr/lib/postgresql. + + -- Martin Pitt Wed, 26 Oct 2005 20:45:02 +0100 + +postgresql-8.1 (8.0+8.1beta4-1) experimental; urgency=low + + * Upgrade to 8.1beta4 release. + * Adopt patches to new upstream version: + - 09-relax-sslkey-permscheck.patch + * debian/postgresql-8.1.postrm: clean_dir(): Ensure that directory is not a + symbolic link before attempting to rmdir it. Closes: #333867 + * debian/rules: Remove obsolete --disable-spinlocks build option for mips. + + -- Martin Pitt Mon, 24 Oct 2005 16:59:53 +0200 + +postgresql-8.1 (8.0+8.1beta3-1) experimental; urgency=low + + * Upgrade to 8.1beta3 release. + * Drop debian/patches/81-beta2.patch: beta2->beta3 changes are too big to be + sensibly stuffed into a patch. + * Adopt patches to new upstream version: + - 03-gettext-domains.patch + * Remove patches which are upstream now: + - 52-contrib-dbf2pg-errorcheck.patch + - 53-contrib-dbf2pg-textfield + * debian/patches/09-relax-sslkey-permscheck.patch: Use effective rather than + real group id for checking the private SSL certificate permissions. It + does not make any practical difference, but is more consistent. + * Rename patch 01-top-makefile.patch to 01-build-contrib.patch to give a + better idea of what it does. + + -- Martin Pitt Thu, 13 Oct 2005 18:32:33 +0200 + +postgresql-8.1 (8.0+8.1beta-4) experimental; urgency=low + + * Add debian/patches/09-relax-sslkey-permscheck.patch: + - Relax security check on private SSL key file: The file is also + considered safe if it has owner and/or group "root", and if it is + group-readable (unless the group is something other than root or the + database owner group). + - See bug #327901. + + -- Martin Pitt Wed, 21 Sep 2005 22:52:39 +0200 + +postgresql-8.1 (8.0+8.1beta-3) experimental; urgency=low + + * Add debian/patches/81-beta2.patch: Upgrade to 8.1beta2 release. + * Remove debian/patches/80-s_lock.h-m68k.patch: Included upstream now. + + -- Martin Pitt Mon, 19 Sep 2005 08:31:22 +0200 + +postgresql-8.1 (8.0+8.1beta-2) experimental; urgency=low + + * debian/postgresql-8.1.postrm: Do not remove an empty /var/log/postgresql, + postgresql-common now cares for it to not break log rotation. (See + #325330) + * Remove debian/postgresql-server-dev-8.1.manpages: Do not install the + manpage, since it belongs to libpq-dev (which is currently built by + postgresql-8.0). Closes: #327379 + * debian/postgresql-server-dev-8.1.install: Ship pg_config. + * Build-depend on libpq-dev to pull in libpq4 dependencies for binary + packages. This hack is necessary as long as we build libpq from + postgresql-8.0. Closes: #327765 + + -- Martin Pitt Tue, 13 Sep 2005 22:04:54 +0200 + +postgresql-8.1 (8.0+8.1beta-1) experimental; urgency=low + + * First public beta version. + + -- Martin Pitt Fri, 26 Aug 2005 09:00:47 +0200 + +postgresql-8.1 (8.0+8.1alpha-1) experimental; urgency=low + + * New upstream snapshot release. The first beta is close to be released, and + I want to be prepared for that. + * Package based on postgresql-8.0 8.0.3-13; don't build client libraries yet + until 8.1 final is released. + + -- Martin Pitt Wed, 24 Aug 2005 08:34:00 +0200 + +postgresql-8.0 (8.0.3-13) unstable; urgency=low + + * debian/control: Fix libpq4 description, it is compatible with servers + starting from 7.3. + * Move back client include files to /usr/include/postgresql/ for now to + not render all client packages unbuildable which have not yet converted + to pg_config: + - debian/rules: Configure with include dir /usr/include/postgresql. + - debian/libecpg-dev.install, debian/libpq-dev.install: Install files from + and to /usr/include/postgresql + - Add debian/patches/13_server_includedir.patch: Change server include + directory back to /usr/include/postgresql/8.0/server since we do want to + keep apart server include files. + - Closes: #322085 + * Drop obsolete xml contrib module, build and ship xml2 instead: + - Remove debian/patches/51-contrib-xml-enable.patch + - Add debian/patches/51-contrib-xml2-enable.patch + - debian/control: Add build dependency libxslt1-dev. + - debian/postgresql-contrib-8.0.install: Ship pgxml.so, drop pgxml_dom.so. + - Closes: #322777 + * Add debian/patches/14-mips-gcc4.patch: + - Add a proper test-and-set function for mips and mipsel. Thanks to Thiemo + Seufer for the patch and Aurelien Jarno for his help. This now also + works with gcc 4. + * debian/rules: Remove the --disable-spinlocks option for mips again, now + that we have a proper patch for that. + + -- Martin Pitt Sat, 20 Aug 2005 17:34:01 +0200 + +postgresql-8.0 (8.0.3-12) unstable; urgency=low + + * debian/rules: + - Robustify log output in case of a failed test suite; also print out + regression.diffs if it fails. Closes: #319218 + - Don't run the test suite if DEB_BUILD_OPTIONS contains "nocheck". + * Add debian/check_installed_files to check for upstream installed files + which are not shipped in any deb. + * debian/postgresql-contrib-8.0.install: Ship pgxml_dom.so. Closes: #318922 + + -- Martin Pitt Sun, 24 Jul 2005 17:35:56 +0200 + +postgresql-8.0 (8.0.3-11) unstable; urgency=low + + * Add debian/patches/12-disable-root-check.patch: Disable "am I root" test + in initdb and postmaster to be able to run the test suite at build time. + This check is already done in pg_createcluster. + * debian/rules: Remove all the chown/setuid crack and simply call "make + check" now; print the log files if the test fails. + * debian/patches/10-testsuite-params.patch: Disable authentication in the + test suite db since ident authentication does not work with fakeroot. + + -- Martin Pitt Fri, 15 Jul 2005 13:31:51 +0300 + +postgresql-8.0 (8.0.3-10) unstable; urgency=low + + * debian/rules: If the test suite fails, don't let the build fail but rather + cat the log files. Once the test suite calling works reliably, the + previous behaviour can be restored. + + -- Martin Pitt Thu, 14 Jul 2005 14:19:30 +0300 + +postgresql-8.0 (8.0.3-9) unstable; urgency=low + + * Bump Standards-Version to 3.6.2. + * debian/rules: Use start-stop-daemon instead of su to call the test suite + since su requires a terminal. + * debian/rules: Disable spinlocks on mips and mipsel for now since they + FTBFS with gcc-4.0. + + -- Martin Pitt Wed, 13 Jul 2005 22:22:59 +0300 + +postgresql-8.0 (8.0.3-8) unstable; urgency=low + + * postgresql-client-8.0: Now suggest postgresql-8.0; clarified the + description wrt the server package (see #313247). + * Fix README.Debian symlink. + * Add debian/patches/10-testsuite-params.patch: Use /tmp as the socket + directory when running the test suite. + * debian/rules: Call the test suite when building the package. Since + creating databases as root is not permitted, do this as "nobody" if run by + root (as on the buildds); don't do it at all if run with fakeroot. + + -- Martin Pitt Tue, 12 Jul 2005 19:10:03 +0300 + +postgresql-8.0 (8.0.3-7) unstable; urgency=low + + * Removed some redundant configure options which cdbs applies anyway. + * configure with --enable-thread-safety-force on HPPA since the configure + check triggers a kernel bug on the buildd. (See #315440) + * debian/postgresql-8.0.init: autovac-* functions in postgresql-common were + renamed to autovac_* to comply to POSIX shell standard (see #315551). + Adaped dependencies. + + -- Martin Pitt Sun, 26 Jun 2005 14:23:32 +0200 + +postgresql-8.0 (8.0.3-6) unstable; urgency=low + + * Added debian/postgresql-8.0.links: Symlink README.Debian from + postgresql-common. + * Added debian/patches/08-timezone-inttimestamps.patch (stolen from CVS + head): Fix integer timestamps in time zone handling. + Closes: #249417, #311533. + * debian/rules: Fix POT file generation. + * Added debian/patches/09-libpq-defaultsocketdir.patch: + - Set default socket directory for libpq to /var/run/postgresql. + Closes: #313507, #313602 + * Adjusted packages to follow upstream library SONAME change in 8.0.3: + libecpg4 -> libecpg5, libecpg-compat1 -> libecpg-compat2, + libpgtypes1 -> libpgtypes2. Closes: #313452, #313453, #313454 + + -- Martin Pitt Tue, 14 Jun 2005 19:58:10 +0200 + +postgresql-8.0 (8.0.3-5) unstable; urgency=low + + * debian/rules: Generate POT files to help translators. + * Added debian/libpq-dev.manpages: Install pg_wrapper(1) manpage. + Closes: #311671 + * debian/control: Restrict libpq-dev conflict to postgresql-dev to + versions << 7.5. Closes: #312827 + + -- Martin Pitt Fri, 10 Jun 2005 19:01:20 +0200 + +postgresql-8.0 (8.0.3-4) unstable; urgency=low + + * First unstable upload. + * debian/control: Now build with libreadline5-dev instead of version 4. + + -- Martin Pitt Tue, 7 Jun 2005 12:15:43 +0200 + +postgresql-8.0 (8.0.3-3) experimental; urgency=low + + * Added libpq4 dependency to libpq-dev. + * postgresql-contrib-8.0.install: Correct paths to install missing shared + files and documentation. (Closes: #311553) + * libpq-dev.install: Install some more header files from server/ which are + required by client libraries. + + -- Martin Pitt Mon, 6 Jun 2005 12:24:57 +0200 + +postgresql-8.0 (8.0.3-2) experimental; urgency=low + + * Added CAN numbers to previous changelog entries. + * debian/patches/07-postgresql.conf.patch: Enable listen_addresses = '*' by + default. + * debian/control, libpq-dev: Conflict to and replace postgresql-dev. + + -- Martin Pitt Tue, 31 May 2005 11:09:48 +0200 + +postgresql-8.0 (8.0.3-1) experimental; urgency=low + + * New upstream release: + - Prevent calling conversion functions by users. [CAN-2005-1409] + - Prevent calling tsearch2 functions by users. [CAN-2005-1410] + * debian/libpq-dev.{install,links}: Install pg_config into + /usr/lib/postgresql/8.0/bin to make it print correct paths, and install a + symlink into /usr/bin instead. Closes: #305200 + * debian/rules: Change include dir configure option to + /usr/include/postgresql/8.0, so that different versions of + postgresql-server-dev- do not conflict with each other. Since + applications using the libpq-dev are supposed to use pg_config, this + should not break them either. + + -- Martin Pitt Thu, 12 May 2005 23:37:56 +0200 + +postgresql-8.0 (8.0.2-1) experimental; urgency=low + + * New upstream release: + - Removed debian/patches/02-libpq-soname.patch, upstream adopted SONAME + change to libpq4. + * Ship "reindexdb" in -contrib. + * Added debian/patches/02_pager.patch: Use /usr/bin/pager as default pager + in psql. Closes: #304459 + * Added debian/postgresql-doc-8.0.doc-base: Register doc package in + doc-base. + + -- Martin Pitt Tue, 19 Apr 2005 21:19:50 +1000 + +postgresql-8.0 (8.0.1-4) experimental; urgency=low + + * Ship pg_config in libpq-dev instead of postgresql-8.0; added + proper package conflict. Closes: #303257 + * Install pg_config in /usr/bin instead of 8.0-specific bin dir. + Closes: #302368 + * debian/postgresql-8.0.init: Added autovacuum functions. + + -- Martin Pitt Tue, 5 Apr 2005 23:15:31 +0200 + +postgresql-8.0 (8.0.1-3) experimental; urgency=low + + * Dropped pgxs package, the Makefiles are now part of postgresql-server-dev. + * -contrib: Only recommend, not depend on libpg-perl and libdbd-pg-perl. + * Renamed packages pg-pl*-8.0 to postgresql-pl*-8.0 for consistency. + * Added debian/patches/07-postgresql.conf.patch: + - Patch for Debian changes to the default configuration. + - Enable stats_row_level to allow pg_autovacuum to work. + + -- Martin Pitt Sat, 2 Apr 2005 18:21:57 +0200 + +postgresql-8.0 (8.0.1-2) experimental; urgency=low + + * Changed dependency of pg-pltcl-8.0 from libtcl8.4 to tcl8.4 + * Now depend on postgresql-common >= 3 which provides more maintainer script + functions. + * Compress manpages. + + -- Martin Pitt Sun, 20 Mar 2005 21:23:10 +0100 + +postgresql-8.0 (8.0.1-1) experimental; urgency=low + + * New upstream release. Closes: #274043, #291350 + - Ignores shell backticks with invalid meta-commands. Closes: #285844 + - Fixes uninitialized error strings when connecting to a server which is + down. Closes: #264603, #277757 + - configure script supports GNU/Hurd and GNU/k*BSD. Closes: #262081 + - Fixes comma splices in HTML documentation. Closes: #243781 + - Now upper() and lower() work also for Unicode characters. + Closes: #139389, #290118, #290399 + - New configuration variable max_stack_depth which prevents DoS situations + due to infinite recursion. Closes: #239811 + - Reportedly works with Turkish locale. Closes: #305886 + - This version is not vulnerable against the following security issues: + . Load arbitrary shared libs, execute startup function [CAN-2005-0227] + . Execute functions with aggregate wrapper [CAN-2005-0244] + . Buffer overflow and 64-bit issues in contrib/intagg [CAN-2005-0246] + . Buffer overflows in the PL/PGSQL parser in gram.y [CAN-2005-0247] + . Insecure temporary files in make_oidjoins_check [CAN-2004-0977] + * Splitted development package into libpq-dev and postgresql-server-dev. + Closes: #280417 + * Splitted libecpg4 into libecpg4, libecpg-compat1 and libpgtypes1. + * Old libpgtcl package does not exist any more. The PL/TCL procedural + language is now shipped in pg-pltcl8.0, the TCL client library is not + shipped by PostgreSQL any more. Closes: #280418 + * Now use /var/lib/postgresql/ as (default) data directory. Closes: #285929 + + -- Martin Pitt Sun, 20 Feb 2005 19:17:17 +0100 + --- postgresql-8.1-8.1.4.orig/debian/libecpg-dev.install +++ postgresql-8.1-8.1.4/debian/libecpg-dev.install @@ -0,0 +1,12 @@ +usr/include/postgresql/ecpg*.h +usr/include/postgresql/informix/* +usr/include/postgresql/pgtypes_*.h +usr/include/postgresql/sql3types.h +usr/include/postgresql/sqlca.h +usr/lib/postgresql/8.1/bin/ecpg usr/bin +usr/lib/libecpg.so +usr/lib/libecpg_compat.so +usr/lib/libpgtypes.so +usr/lib/libecpg.a +usr/lib/libecpg_compat.a +usr/lib/libpgtypes.a --- postgresql-8.1-8.1.4.orig/debian/libpq4.shlibs +++ postgresql-8.1-8.1.4/debian/libpq4.shlibs @@ -0,0 +1 @@ +libpq 4 libpq4 (>= 8.1.4) --- postgresql-8.1-8.1.4.orig/debian/libecpg-dev.manpages +++ postgresql-8.1-8.1.4/debian/libecpg-dev.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/postgresql/8.1/man/man1/ecpg.1 --- postgresql-8.1-8.1.4.orig/debian/libpq-dev.manpages +++ postgresql-8.1-8.1.4/debian/libpq-dev.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/postgresql/8.1/man/man1/pg_config.1 --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.postinst +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.postinst @@ -0,0 +1,12 @@ +#!/bin/sh -e + +VERSION=8.1 + + +if [ "$1" = configure ]; then + . /usr/share/postgresql-common/maintscripts-functions + + configure_version $VERSION "$2" +fi + +#DEBHELPER# --- postgresql-8.1-8.1.4.orig/debian/libecpg-compat2.install +++ postgresql-8.1-8.1.4/debian/libecpg-compat2.install @@ -0,0 +1 @@ +usr/lib/libecpg_compat.so.2* --- postgresql-8.1-8.1.4.orig/debian/compat +++ postgresql-8.1-8.1.4/debian/compat @@ -0,0 +1 @@ +5 --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.postrm +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.postrm @@ -0,0 +1,53 @@ +#!/bin/sh -e + +#DEBHELPER# + +VERSION=8.1 + +clean_dir() { + if [ -d "$1" -a ! -L "$1" ]; then + rmdir "$1" >/dev/null 2>/dev/null || true + fi +} + +drop_cluster() { + # if we still have the postgresql-common package, use it to also shutdown + # server, etc.; otherwise just remove the directories + if [ -x /usr/bin/pg_dropcluster ]; then + pg_dropcluster --stop-server $VERSION "$1" + else + # remove data directory + if DATA=$(readlink -f /etc/postgresql/$VERSION/"$1"/pgdata); then + rm -rf "$DATA" /etc/postgresql/$VERSION/"$1"/pgdata + fi + + # remove log file + if LOG=$(readlink -f /etc/postgresql/$VERSION/"$1"/log); then + rm -rf "$LOG" /etc/postgresql/$VERSION/"$1"/log + fi + + # remove conffiles + for f in pg_hba.conf pg_ident.conf postgresql.conf start.conf; do + rm -f /etc/postgresql/$VERSION/"$1"/$f + done + + clean_dir /etc/postgresql/$VERSION/"$1" + fi +} + +if [ "$1" = purge ]; then + [ -d "/etc/postgresql/$VERSION" ] || exit 0 + if [ "$(ls /etc/postgresql/$VERSION)" ]; then + for c in /etc/postgresql/$VERSION/*; do + [ -e "$c/pgdata" ] || continue + cluster=$(basename "$c") + echo "Dropping cluster $cluster..." + drop_cluster "$cluster" + done + fi + + clean_dir /etc/postgresql/$VERSION + clean_dir /etc/postgresql + clean_dir /var/lib/postgresql/$VERSION + clean_dir /var/lib/postgresql +fi --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.links +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.links @@ -0,0 +1 @@ +/usr/share/doc/postgresql-common/README.Debian.gz /usr/share/doc/postgresql-8.1/README.Debian.gz --- postgresql-8.1-8.1.4.orig/debian/postgresql-client-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-client-8.1.install @@ -0,0 +1,32 @@ +usr/lib/postgresql/8.1/bin/clusterdb +usr/lib/postgresql/8.1/bin/pg_dumpall +usr/lib/postgresql/8.1/bin/pg_dump +usr/lib/postgresql/8.1/bin/createdb +usr/lib/postgresql/8.1/bin/createlang +usr/lib/postgresql/8.1/bin/createuser +usr/lib/postgresql/8.1/bin/dropdb +usr/lib/postgresql/8.1/bin/droplang +usr/lib/postgresql/8.1/bin/dropuser +usr/lib/postgresql/8.1/bin/reindexdb +usr/lib/postgresql/8.1/bin/pg_restore +usr/lib/postgresql/8.1/bin/psql +usr/lib/postgresql/8.1/bin/vacuumdb +usr/lib/postgresql/8.1/bin/vacuumlo +usr/share/postgresql/8.1/man/man1/pg_restore.1 +usr/share/postgresql/8.1/man/man1/psql.1 +usr/share/postgresql/8.1/man/man1/vacuumdb.1 +usr/share/postgresql/8.1/man/man1/clusterdb.1 +usr/share/postgresql/8.1/man/man1/pg_dump.1 +usr/share/postgresql/8.1/man/man1/pg_dumpall.1 +usr/share/postgresql/8.1/man/man1/createdb.1 +usr/share/postgresql/8.1/man/man1/createlang.1 +usr/share/postgresql/8.1/man/man1/createuser.1 +usr/share/postgresql/8.1/man/man1/dropdb.1 +usr/share/postgresql/8.1/man/man1/droplang.1 +usr/share/postgresql/8.1/man/man1/dropuser.1 +usr/share/postgresql/8.1/man/man1/reindexdb.1 +usr/share/postgresql/8.1/man/man7/*7 +usr/share/postgresql/8.1/psqlrc.sample +usr/share/locale/*/LC_MESSAGES/pg_dump-8.1.mo +usr/share/locale/*/LC_MESSAGES/psql-8.1.mo +usr/share/locale/*/LC_MESSAGES/pgscripts-8.1.mo --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.prerm +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.prerm @@ -0,0 +1,11 @@ +#!/bin/sh -e + +VERSION=8.1 + +#DEBHELPER# + +if [ "$1" = remove ]; then + . /usr/share/postgresql-common/maintscripts-functions + remove_version $VERSION +fi + --- postgresql-8.1-8.1.4.orig/debian/postgresql-doc-8.1.doc-base +++ postgresql-8.1-8.1.4/debian/postgresql-doc-8.1.doc-base @@ -0,0 +1,13 @@ +Document: postgresql-8.1 +Title: PostgreSQL 8.1 Documentation +Author: The PostgreSQL Global Development Group +Abstract: The documentation for the PostgreSQL database management system, + version 8.1. PostgreSQL is a sophisticated Object-Relational DBMS, supporting + almost all SQL constructs, including subselects, transactions, and + user-defined types and functions. +Section: Apps/Databases + +Format: HTML +Index: /usr/share/doc/postgresql-doc-8.1/html/index.html +Files: /usr/share/doc/postgresql-doc-8.1/html/* + --- postgresql-8.1-8.1.4.orig/debian/disable-root-check.patch +++ postgresql-8.1-8.1.4/debian/disable-root-check.patch @@ -0,0 +1,36 @@ +diff -ruN postgresql-8.1.3-old/src/backend/main/main.c postgresql-8.1.3/src/backend/main/main.c +--- postgresql-8.1.3-old/src/backend/main/main.c 2005-07-15 14:04:23.000000000 +0300 ++++ postgresql-8.1.3/src/backend/main/main.c 2005-07-15 14:04:33.000000000 +0300 +@@ -204,7 +204,7 @@ + strcmp(argv[1], "-V") == 0))) + { + #ifndef WIN32 +-#ifndef __BEOS__ ++#if 0 + + /* + * Make sure we are not running as root. +diff -ruN postgresql-8.1.3-old/src/bin/initdb/initdb.c postgresql-8.1.3/src/bin/initdb/initdb.c +--- postgresql-8.1.3-old/src/bin/initdb/initdb.c 2005-07-15 14:04:23.000000000 +0300 ++++ postgresql-8.1.3/src/bin/initdb/initdb.c 2005-07-15 14:04:33.000000000 +0300 +@@ -627,7 +627,7 @@ + + pw = getpwuid(geteuid()); + +-#ifndef __BEOS__ /* no root check on BEOS */ ++#if 0 + + if (geteuid() == 0) /* 0 is root's uid */ + { +diff -ruN postgresql-8.1.3-old/src/bin/pg_ctl/pg_ctl.c postgresql-8.1.3/src/bin/pg_ctl/pg_ctl.c +--- postgresql-8.1.3-old/src/bin/pg_ctl/pg_ctl.c 2005-07-15 14:04:23.000000000 +0300 ++++ postgresql-8.1.3/src/bin/pg_ctl/pg_ctl.c 2005-07-15 14:08:38.100000000 +0300 +@@ -1319,7 +1319,7 @@ + * Disallow running as root, to forestall any possible security holes. + */ + #ifndef WIN32 +-#ifndef __BEOS__ /* no root check on BEOS */ ++#if 0 + if (geteuid() == 0) + { + write_stderr(_("%s: cannot be run as root\n" --- postgresql-8.1-8.1.4.orig/debian/libecpg5.install +++ postgresql-8.1-8.1.4/debian/libecpg5.install @@ -0,0 +1 @@ +usr/lib/libecpg.so.5* --- postgresql-8.1-8.1.4.orig/debian/pycompat +++ postgresql-8.1-8.1.4/debian/pycompat @@ -0,0 +1 @@ +2 --- postgresql-8.1-8.1.4.orig/debian/postgresql-server-dev-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-server-dev-8.1.install @@ -0,0 +1,2 @@ +usr/include/postgresql/8.1/* +usr/lib/postgresql/8.1/lib/pgxs/* --- postgresql-8.1-8.1.4.orig/debian/postgresql-contrib-8.1.postinst +++ postgresql-8.1-8.1.4/debian/postgresql-contrib-8.1.postinst @@ -0,0 +1,11 @@ +#!/bin/sh -e + +VERSION=8.1 + +. /usr/share/postgresql-common/maintscripts-functions + +if [ "$1" = configure ]; then + configure_contrib_version $VERSION "$2" +fi + +#DEBHELPER# --- postgresql-8.1-8.1.4.orig/debian/libpq-dev.install +++ postgresql-8.1-8.1.4/debian/libpq-dev.install @@ -0,0 +1,17 @@ +usr/include/postgresql/internal/* +usr/include/postgresql/libpq-fe.h +usr/include/postgresql/libpq/libpq-fs.h +usr/include/postgresql/pg_config*.h +usr/include/postgresql/postgres_ext.h +usr/include/postgresql/8.1/server/catalog/pg_type.h /usr/include/postgresql/catalog +usr/include/postgresql/8.1/server/nodes/nodes.h /usr/include/postgresql/nodes +usr/include/postgresql/8.1/server/utils/{elog,errcodes,palloc}.h /usr/include/postgresql/utils +usr/include/postgresql/8.1/server/{c,pg_config,pg_config_manual,pg_config_os,port}.h /usr/include/postgresql/ +usr/include/postgresql/8.1/server/postgres{,_fe,_ext}.h /usr/include/postgresql/ +usr/include/postgresql/8.1/server/mb/pg_wchar.h /usr/include/postgresql/mb +usr/lib/libpgport.a +usr/lib/libpq.a +usr/lib/libpq.so +usr/lib/postgresql/8.1/bin/pg_config +usr/share/postgresql/8.1/man/man1/pg_config.1 +usr/share/locale/*/LC_MESSAGES/pg_config-8.1.mo --- postgresql-8.1-8.1.4.orig/debian/patches/04-timezone-symlinks.patch +++ postgresql-8.1-8.1.4/debian/patches/04-timezone-symlinks.patch @@ -0,0 +1,31 @@ +diff -ruN postgresql-8.1.1-old/src/timezone/zic.c postgresql-8.1.1/src/timezone/zic.c +--- postgresql-8.1.1-old/src/timezone/zic.c 2004-09-27 21:16:03.000000000 +0200 ++++ postgresql-8.1.1/src/timezone/zic.c 2005-02-08 00:10:42.560848352 +0100 +@@ -611,14 +611,14 @@ + */ + if (!itsdir(toname)) + (void) remove(toname); +- if (link(fromname, toname) != 0) ++ if (1) + { + int result; + + if (mkdirs(toname) != 0) + (void) exit(EXIT_FAILURE); + +- result = link(fromname, toname); ++ result = 1; + #ifdef HAVE_SYMLINK + if (result != 0 && + access(fromname, F_OK) == 0 && +@@ -632,8 +632,10 @@ + symlinkcontents = ecatalloc(symlinkcontents, fromfile); + + result = symlink(symlinkcontents, toname); ++ /* + if (result == 0) + warning(_("hard link failed, symbolic link used")); ++ */ + ifree(symlinkcontents); + } + #endif --- postgresql-8.1-8.1.4.orig/debian/patches/06-libpq-defaultsocketdir.patch +++ postgresql-8.1-8.1.4/debian/patches/06-libpq-defaultsocketdir.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1.3-old/src/include/pg_config_manual.h postgresql-8.1.3/src/include/pg_config_manual.h +--- postgresql-8.1.3-old/src/include/pg_config_manual.h 2004-09-10 16:27:37.000000000 +0200 ++++ postgresql-8.1.3/src/include/pg_config_manual.h 2005-06-14 19:21:28.100000000 +0200 +@@ -160,7 +160,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" + + /* + * The random() function is expected to yield values between 0 and --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-unknown-array-coerce.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-unknown-array-coerce.patch @@ -0,0 +1,50 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_coerce.c.diff?r1=2.132.2.3&r2=2.132.2.4 + +Repair incorrect check for coercion of unknown literal to ANYARRAY, a +bug I introduced in 7.4.1 :-(. It's correct to allow unknown to be +coerced to ANY or ANYELEMENT, since it's a real-enough data type, but +it most certainly isn't an array datatype. This can cause a backend +crash but AFAICT is not exploitable as a security hole. Per report +from Michael Fuhr. + +Note: as fixed in HEAD, this changes a constant in the pg_stats view, +resulting in a change in the expected regression outputs. The +back-branch patches have been hacked to avoid that, so that +pre-existing installations won't start failing their regression tests. + +--- pgsql/src/backend/parser/parse_coerce.c 2006/01/17 17:33:20 2.132.2.3 ++++ pgsql/src/backend/parser/parse_coerce.c 2006/10/11 20:21:11 2.132.2.4 +@@ -130,11 +130,28 @@ coerce_type(ParseState *pstate, Node *no + return node; + } + if (targetTypeId == ANYOID || +- targetTypeId == ANYARRAYOID || +- targetTypeId == ANYELEMENTOID) ++ targetTypeId == ANYELEMENTOID || ++ (targetTypeId == ANYARRAYOID && ++ (inputTypeId != UNKNOWNOID || ++ (IsA(node, Const) && ((Const *) node)->constisnull)))) /* HACK */ + { +- /* assume can_coerce_type verified that implicit coercion is okay */ +- /* NB: we do NOT want a RelabelType here */ ++ /* ++ * Assume can_coerce_type verified that implicit coercion is okay. ++ * ++ * Note: by returning the unmodified node here, we are saying that ++ * it's OK to treat an UNKNOWN constant as a valid input for a ++ * function accepting ANY or ANYELEMENT. This should be all right, ++ * since an UNKNOWN value is still a perfectly valid Datum. However ++ * an UNKNOWN value is definitely *not* an array, and so we mustn't ++ * accept it for ANYARRAY. (Instead, we will call anyarray_in below, ++ * which will produce an error.) ++ * ++ * HACK: if it's a NULL UNKNOWN constant, return it as-is, same as ++ * before. This is just to avoid changing the pg_stats view and thus ++ * the expected regression test results in back branches. ++ * ++ * NB: we do NOT want a RelabelType here. ++ */ + return node; + } + if (inputTypeId == UNKNOWNOID && IsA(node, Const)) + --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-disable-update-aggregates.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-disable-update-aggregates.patch @@ -0,0 +1,33 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.326.2.1&r2=1.326.2.2 + +Disallow aggregate functions in UPDATE commands (unless within a +sub-SELECT). This is disallowed by the SQL spec because it doesn't +have any very sensible interpretation. Historically Postgres has +allowed it but behaved strangely. As of PG 8.1 a server crash is +possible if the MIN/MAX index optimization gets applied; rather than +try to "fix" that, it seems best to just enforce the spec restriction. +Per report from Josh Drake and Alvaro Herrera. + +only affects 8.1 + +--- pgsql/src/backend/parser/analyze.c 2005/11/22 18:23:12 1.326.2.1 ++++ pgsql/src/backend/parser/analyze.c 2006/06/21 18:30:19 1.326.2.2 +@@ -2333,9 +2333,16 @@ transformUpdateStmt(ParseState *pstate, + qry->jointree = makeFromExpr(pstate->p_joinlist, qual); + + qry->hasSubLinks = pstate->p_hasSubLinks; +- qry->hasAggs = pstate->p_hasAggs; ++ ++ /* ++ * Top-level aggregates are simply disallowed in UPDATE, per spec. ++ * (From an implementation point of view, this is forced because the ++ * implicit ctid reference would otherwise be an ungrouped variable.) ++ */ + if (pstate->p_hasAggs) +- parseCheckAggregates(pstate, qry); ++ ereport(ERROR, ++ (errcode(ERRCODE_GROUPING_ERROR), ++ errmsg("cannot use aggregate function in UPDATE"))); + + /* + * Now we are done with SELECT-like processing, and can get on with --- postgresql-8.1-8.1.4.orig/debian/patches/08-unnecessary-libs.patch +++ postgresql-8.1-8.1.4/debian/patches/08-unnecessary-libs.patch @@ -0,0 +1,89 @@ +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/interfaces/ecpg/compatlib/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/interfaces/ecpg/compatlib/Makefile +--- postgresql-8.1.4/src/interfaces/ecpg/compatlib/Makefile 2005-03-14 18:27:49.000000000 +0100 ++++ postgresql-8.1.4/src/interfaces/ecpg/compatlib/Makefile 2006-09-27 22:57:24.000000000 +0200 +@@ -20,8 +20,8 @@ + override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) \ + -I$(top_srcdir)/src/include/utils $(CPPFLAGS) + override CFLAGS += $(PTHREAD_CFLAGS) +-SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \ +- $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS) ++SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes \ ++ $(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS) + + OBJS= informix.o + +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/interfaces/ecpg/ecpglib/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/interfaces/ecpg/ecpglib/Makefile +--- postgresql-8.1.4/src/interfaces/ecpg/ecpglib/Makefile 2005-12-06 03:29:26.000000000 +0100 ++++ postgresql-8.1.4/src/interfaces/ecpg/ecpglib/Makefile 2006-09-27 22:57:24.000000000 +0200 +@@ -29,7 +29,7 @@ + $(filter snprintf.o, $(LIBOBJS)) + + SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \ +- $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS) ++ $(filter -lintl, $(LIBS)) $(PTHREAD_LIBS) + + ifeq ($(PORTNAME), win32) + # Link to shfolder.dll instead of shell32.dll +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/interfaces/ecpg/pgtypeslib/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/interfaces/ecpg/pgtypeslib/Makefile +--- postgresql-8.1.4/src/interfaces/ecpg/pgtypeslib/Makefile 2005-12-06 06:26:30.000000000 +0100 ++++ postgresql-8.1.4/src/interfaces/ecpg/pgtypeslib/Makefile 2006-09-27 22:57:24.000000000 +0200 +@@ -24,8 +24,6 @@ + # Need to recompile any libpgport object files + LIBS := $(filter-out -lpgport, $(LIBS)) + +-SHLIB_LINK += -lm +- + OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o \ + pgstrcasecmp.o \ + $(filter rint.o snprintf.o, $(LIBOBJS)) +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/interfaces/libpq/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/interfaces/libpq/Makefile +--- postgresql-8.1.4/src/interfaces/libpq/Makefile 2005-08-29 02:47:35.000000000 +0200 ++++ postgresql-8.1.4/src/interfaces/libpq/Makefile 2006-09-27 22:57:24.000000000 +0200 +@@ -54,9 +54,9 @@ + # shared library link. (The order in which you list them here doesn't + # matter.) + ifneq ($(PORTNAME), win32) +-SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(PTHREAD_LIBS) ++SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lkrb5 -lssl -lsocket -lintl, $(LIBS)) $(PTHREAD_LIBS) + else +-SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl $(PTHREAD_LIBS), $(LIBS)) ++SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lkrb5 -lssl -lsocket -lintl $(PTHREAD_LIBS), $(LIBS)) + endif + ifeq ($(PORTNAME), win32) + SHLIB_LINK += -lshfolder -lwsock32 -lws2_32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS)) +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/pl/plperl/GNUmakefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/pl/plperl/GNUmakefile +--- postgresql-8.1.4/src/pl/plperl/GNUmakefile 2005-07-13 19:12:56.000000000 +0200 ++++ postgresql-8.1.4/src/pl/plperl/GNUmakefile 2006-09-27 22:58:01.000000000 +0200 +@@ -34,7 +34,7 @@ + + OBJS = plperl.o spi_internal.o SPI.o + +-SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS) ++SHLIB_LINK = $(filter-out -lm -lcrypt, $(perl_embed_ldflags) $(BE_DLLLIBS)) + + REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl + REGRESS = plperl plperl_trigger plperl_shared plperl_elog +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/pl/plpython/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/pl/plpython/Makefile +--- postgresql-8.1.4/src/pl/plpython/Makefile 2005-08-12 23:44:51.000000000 +0200 ++++ postgresql-8.1.4/src/pl/plpython/Makefile 2006-09-27 22:58:36.000000000 +0200 +@@ -56,7 +56,7 @@ + endif + + +-SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs) ++SHLIB_LINK = $(filter-out -lm -lutil -ldl, $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)) + + REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonu + REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/pl/tcl/Makefile postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/pl/tcl/Makefile +--- postgresql-8.1.4/src/pl/tcl/Makefile 2005-05-24 19:07:41.000000000 +0200 ++++ postgresql-8.1.4/src/pl/tcl/Makefile 2006-09-27 22:59:02.000000000 +0200 +@@ -30,7 +30,7 @@ + + + ifneq ($(PORTNAME), win32) +-SHLIB_LINK = $(BE_DLLLIBS) $(TCL_LIB_SPEC) $(TCL_LIBS) -lc ++SHLIB_LINK = $(filter-out -lm -ldl, $(BE_DLLLIBS) $(TCL_LIB_SPEC) $(TCL_LIBS) -lc) + else + SHLIB_LINK = $(TCL_LIB_SPEC) $(BE_DLLLIBS) + endif --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-duration-logging-crash.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-duration-logging-crash.patch @@ -0,0 +1,115 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c.diff?r1=1.468.2.5&r2=1.468.2.6 + +Fix core dump in duration logging for a V3-protocol Execute message +when what's being executed is a COMMIT or ROLLBACK. Per report from +Sergey Koposov. + +(8.0 and before don't have the bug due to lack of any logging at all here) + +--- pgsql/src/backend/tcop/postgres.c 2006/06/11 15:49:36 1.468.2.5 ++++ pgsql/src/backend/tcop/postgres.c 2006/08/13 22:18:22 1.468.2.6 +@@ -1642,12 +1642,14 @@ exec_execute_message(const char *portal_ + Portal portal; + bool completed; + char completionTag[COMPLETION_TAG_BUFSIZE]; ++ const char *sourceText = NULL; + struct timeval start_t, + stop_t; + bool save_log_duration = log_duration; + int save_log_min_duration_statement = log_min_duration_statement; + bool save_log_statement_stats = log_statement_stats; +- bool execute_is_fetch = false; ++ bool is_xact_command; ++ bool execute_is_fetch; + + /* Adjust destination to tell printtup.c what to do */ + dest = whereToSendOutput; +@@ -1661,15 +1663,6 @@ exec_execute_message(const char *portal_ + errmsg("portal \"%s\" does not exist", portal_name))); + + /* +- * If we re-issue an Execute protocol request against an existing portal, +- * then we are only fetching more rows rather than completely re-executing +- * the query from the start. atStart is never reset for a v3 portal, so we +- * are safe to use this check. +- */ +- if (!portal->atStart) +- execute_is_fetch = true; +- +- /* + * If the original query was a null string, just return + * EmptyQueryResponse. + */ +@@ -1680,6 +1673,17 @@ exec_execute_message(const char *portal_ + return; + } + ++ /* Does the portal contain a transaction command? */ ++ is_xact_command = IsTransactionStmtList(portal->parseTrees); ++ ++ /* ++ * If we re-issue an Execute protocol request against an existing portal, ++ * then we are only fetching more rows rather than completely re-executing ++ * the query from the start. atStart is never reset for a v3 portal, so we ++ * are safe to use this check. ++ */ ++ execute_is_fetch = !portal->atStart; ++ + /* Should we display the portal names here? */ + if (execute_is_fetch) + { +@@ -1688,8 +1692,18 @@ exec_execute_message(const char *portal_ + } + else if (portal->sourceText) + { +- debug_query_string = portal->sourceText; +- pgstat_report_activity(portal->sourceText); ++ /* ++ * We must copy the sourceText into MessageContext in case the ++ * portal is destroyed during finish_xact_command. Can avoid ++ * the copy if it's not an xact command, though. ++ */ ++ if (is_xact_command) ++ sourceText = pstrdup(portal->sourceText); ++ else ++ sourceText = portal->sourceText; ++ ++ debug_query_string = sourceText; ++ pgstat_report_activity(sourceText); + } + else + { +@@ -1712,12 +1726,11 @@ exec_execute_message(const char *portal_ + ResetUsage(); + + if (log_statement == LOGSTMT_ALL) +- /* We have the portal, so output the source query. */ + ereport(LOG, + (errmsg("statement: %sEXECUTE %s [PREPARE: %s]", + (execute_is_fetch) ? "FETCH from " : "", + (*portal_name != '\0') ? portal_name : "", +- portal->sourceText ? portal->sourceText : ""))); ++ sourceText ? sourceText : ""))); + + BeginCommand(portal->commandTag, dest); + +@@ -1763,7 +1776,7 @@ exec_execute_message(const char *portal_ + + if (completed) + { +- if (IsTransactionStmtList(portal->parseTrees)) ++ if (is_xact_command) + { + /* + * If this was a transaction control statement, commit it. We +@@ -1828,8 +1841,8 @@ exec_execute_message(const char *portal_ + (stop_t.tv_usec - start_t.tv_usec) / 1000), + (long) (stop_t.tv_usec - start_t.tv_usec) % 1000, + (execute_is_fetch) ? "FETCH from " : "", +- (*portal_name != '\0') ? portal_name : "", +- portal->sourceText ? portal->sourceText : ""))); ++ (*portal_name != '\0') ? portal_name : "", ++ sourceText ? sourceText : ""))); + } + + if (save_log_statement_stats) --- postgresql-8.1-8.1.4.orig/debian/patches/05-check-rlimits-nofile.patch +++ postgresql-8.1-8.1.4/debian/patches/05-check-rlimits-nofile.patch @@ -0,0 +1,33 @@ +diff -ruN postgresql-snapshot-old/src/backend/storage/file/fd.c postgresql-snapshot/src/backend/storage/file/fd.c +--- postgresql-snapshot-old/src/backend/storage/file/fd.c 2005-08-08 05:11:49.000000000 +0200 ++++ postgresql-snapshot/src/backend/storage/file/fd.c 2005-08-22 19:21:42.000000000 +0200 +@@ -51,6 +51,7 @@ + #include "storage/fd.h" + #include "storage/ipc.h" + ++#include + + /* + * We must leave some file descriptors free for system(), the dynamic loader, +@@ -343,15 +344,21 @@ + int used = 0; + int highestfd = 0; + int j; ++ struct rlimit rlim; + + size = 1024; + fd = (int *) palloc(size * sizeof(int)); ++ getrlimit(RLIMIT_NOFILE, &rlim); + + /* dup until failure or probe limit reached */ + for (;;) + { + int thisfd; + ++ /* Don't go beyond RLIMIT_NOFILE */ ++ if (highestfd >= rlim.rlim_cur - 1) ++ break; ++ + thisfd = dup(0); + if (thisfd < 0) + { --- postgresql-8.1-8.1.4.orig/debian/patches/09-relax-sslkey-permscheck.patch +++ postgresql-8.1-8.1.4/debian/patches/09-relax-sslkey-permscheck.patch @@ -0,0 +1,22 @@ +diff -ruN postgresql-8.1beta4-old/src/backend/libpq/be-secure.c postgresql-8.1beta4/src/backend/libpq/be-secure.c +--- postgresql-8.1beta4-old/src/backend/libpq/be-secure.c 2005-10-15 04:49:17.000000000 +0200 ++++ postgresql-8.1beta4/src/backend/libpq/be-secure.c 2005-10-24 16:38:20.000000000 +0200 +@@ -753,13 +753,15 @@ + * permission check in postmaster.c) + */ + #if !defined(WIN32) && !defined(__CYGWIN__) +- if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IRWXG | S_IRWXO)) || +- buf.st_uid != geteuid()) ++ if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IWGRP | S_IRWXO)) || ++ (buf.st_uid != geteuid()) && buf.st_uid != 0) + ereport(FATAL, + (errcode(ERRCODE_CONFIG_FILE_ERROR), + errmsg("unsafe permissions on private key file \"%s\"", + SERVER_PRIVATE_KEY_FILE), +- errdetail("File must be owned by the database user and must have no permissions for \"group\" or \"other\"."))); ++ errdetail("File must be owned by the \ ++database user or root, must have no write permission for \"group\", and must \ ++have no permissions for \"other\"."))); + #endif + + if (!SSL_CTX_use_PrivateKey_file(SSL_context, --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-zzz-sql-fun-typecheck-regression.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-zzz-sql-fun-typecheck-regression.patch @@ -0,0 +1,28 @@ +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/execQual.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/execQual.c +--- postgresql-8.1.4/src/backend/executor/execQual.c 2007-02-06 18:56:39.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/execQual.c 2007-02-06 18:56:43.000000000 +0100 +@@ -497,8 +497,11 @@ + * Note: we allow a reference to a dropped attribute. slot_getattr + * will force a NULL result in such cases. + * +- * Note: we check typmod, but allow the case that the Var has +- * unspecified typmod while the column has a specific typmod. ++ * Note: ideally we'd check typmod as well as typid, but that seems ++ * impractical at the moment: in many cases the tupdesc will have ++ * been generated by ExecTypeFromTL(), and that can't guarantee to ++ * generate an accurate typmod in all cases, because some expression ++ * node types don't carry typmod. + */ + if (attnum > 0) + { +@@ -514,9 +517,7 @@ + /* can't check type if dropped, since atttypid is probably 0 */ + if (!attr->attisdropped) + { +- if (variable->vartype != attr->atttypid || +- (variable->vartypmod != attr->atttypmod && +- variable->vartypmod != -1)) ++ if (variable->vartype != attr->atttypid) + ereport(ERROR, + (errmsg("attribute %d has wrong type", attnum), + errdetail("Table has type %s, but query expects %s.", --- postgresql-8.1-8.1.4.orig/debian/patches/11-server-includedir.patch +++ postgresql-8.1-8.1.4/debian/patches/11-server-includedir.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1.0-old/src/Makefile.global.in postgresql-8.1.0/src/Makefile.global.in +--- postgresql-8.1.0-old/src/Makefile.global.in 2005-11-05 18:54:55.000000000 -0500 ++++ postgresql-8.1.0/src/Makefile.global.in 2005-11-05 18:55:59.000000000 -0500 +@@ -133,7 +133,7 @@ + + # These derived path variables aren't separately configurable. + +-includedir_server = $(pkgincludedir)/server ++includedir_server = $(pkgincludedir)/8.1/server + includedir_internal = $(pkgincludedir)/internal + pgxsdir = $(pkglibdir)/pgxs + --- postgresql-8.1-8.1.4.orig/debian/patches/50-contrib-oracle-enable.patch +++ postgresql-8.1-8.1.4/debian/patches/50-contrib-oracle-enable.patch @@ -0,0 +1,45 @@ +diff -ruN postgresql-8.1.3-old/contrib/Makefile postgresql-8.1.3/contrib/Makefile +--- postgresql-8.1.3-old/contrib/Makefile 2005-09-02 00:02:44.000000000 +0200 ++++ postgresql-8.1.3/contrib/Makefile 2006-04-10 22:41:29.000000000 +0200 +@@ -20,6 +20,7 @@ + lo \ + ltree \ + oid2name \ ++ oracle \ + pg_buffercache \ + pg_trgm \ + pgbench \ +@@ -37,7 +38,6 @@ + # adddepend \ (does not have a makefile) + # mSQL-interface \ (requires msql installed) + # mac \ (does not have a makefile) +-# oracle \ (does not have a makefile) + # start-scripts \ (does not have a makefile) + # xml2 \ (requires libxml installed) + +diff -ruN postgresql-8.1.3-old/contrib/oracle/Makefile postgresql-8.1.3/contrib/oracle/Makefile +--- postgresql-8.1.3-old/contrib/oracle/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ postgresql-8.1.3/contrib/oracle/Makefile 2006-04-10 22:41:29.000000000 +0200 +@@ -0,0 +1,11 @@ ++# oracle conversion Perl scripts ++ ++subdir = contrib/oracle ++top_builddir = ../.. ++include $(top_builddir)/src/Makefile.global ++ ++MODULES = ++SCRIPTS = Ora2Pg.pm ora2pg.pl ++DOCS = README.ora2pg ++ ++include $(top_srcdir)/contrib/contrib-global.mk +diff -ruN postgresql-8.1.3-old/contrib/oracle/ora2pg.pl postgresql-8.1.3/contrib/oracle/ora2pg.pl +--- postgresql-8.1.3-old/contrib/oracle/ora2pg.pl 2003-01-07 23:17:14.000000000 +0100 ++++ postgresql-8.1.3/contrib/oracle/ora2pg.pl 2006-04-10 22:42:04.000000000 +0200 +@@ -17,6 +17,7 @@ + + use strict; + ++use lib '/usr/share/postgresql/8.1/contrib'; + use Ora2Pg; + + # Initialyze the database connection --- postgresql-8.1-8.1.4.orig/debian/patches/07-testsuite-params.patch +++ postgresql-8.1-8.1.4/debian/patches/07-testsuite-params.patch @@ -0,0 +1,13 @@ +diff -ruN postgresql-8.1.3-old/src/test/regress/pg_regress.sh postgresql-8.1.3/src/test/regress/pg_regress.sh +--- postgresql-8.1.3-old/src/test/regress/pg_regress.sh 2005-01-15 06:15:51.000000000 +0200 ++++ postgresql-8.1.3/src/test/regress/pg_regress.sh 2005-07-15 13:28:38.100000000 +0300 +@@ -5,6 +5,9 @@ + : ${TMPDIR=/tmp} + TMPFILE=$TMPDIR/pg_regress.$$ + ++postmaster_options="-c unix_socket_directory=/tmp" ++psql_options='-h /tmp' ++ + help="\ + PostgreSQL regression test driver + --- postgresql-8.1-8.1.4.orig/debian/patches/51-contrib-xml2-enable.patch +++ postgresql-8.1-8.1.4/debian/patches/51-contrib-xml2-enable.patch @@ -0,0 +1,13 @@ +diff -ruN postgresql-8.1.3-old/contrib/Makefile postgresql-8.1.3/contrib/Makefile +--- postgresql-8.1.3-old/contrib/Makefile 2005-08-15 23:07:03.000000000 +0200 ++++ postgresql-8.1.3/contrib/Makefile 2005-08-15 23:07:51.000000000 +0200 +@@ -41,7 +41,8 @@ + tsearch \ + tsearch2 \ + userlock \ +- vacuumlo ++ vacuumlo \ ++ xml2 + + # Missing: + # adddepend \ (does not have a makefile) --- postgresql-8.1-8.1.4.orig/debian/patches/13-tutorial-README.patch +++ postgresql-8.1-8.1.4/debian/patches/13-tutorial-README.patch @@ -0,0 +1,13 @@ +diff -ruN postgresql-8.1.3-old/src/tutorial/README postgresql-8.1.3/src/tutorial/README +--- postgresql-8.1.3-old/src/tutorial/README 2001-10-26 22:45:33.000000000 +0200 ++++ postgresql-8.1.3/src/tutorial/README 2006-04-10 22:17:29.000000000 +0200 +@@ -1,8 +1,7 @@ + This directory contains SQL tutorial scripts. To look at them, first do a + % make + to compile all the scripts and C files for the user-defined functions +-and types. (make needs to be GNU make --- it may be named something +-different on your system, often gmake) ++and types. This requires postgresql-server-dev-8.1 to be installed. + + Then, run psql with the -s (single-step) flag: + % psql -s --- postgresql-8.1-8.1.4.orig/debian/patches/03-gettext-domains.patch +++ postgresql-8.1-8.1.4/debian/patches/03-gettext-domains.patch @@ -0,0 +1,340 @@ +diff -ruN postgresql-8.1beta3-old/src/backend/main/main.c postgresql-8.1beta3/src/backend/main/main.c +--- postgresql-8.1beta3-old/src/backend/main/main.c 2004-12-31 22:59:53.000000000 +0100 ++++ postgresql-8.1beta3/src/backend/main/main.c 2005-10-13 18:00:42.000000000 +0200 +@@ -154,7 +154,7 @@ + * allow startup error messages to be localized. + */ + +- set_pglocale_pgservice(argv[0], "postgres"); ++ set_pglocale_pgservice(argv[0], "postgres-8.1"); + + #ifdef WIN32 + +diff -ruN postgresql-8.1beta3-old/src/backend/nls.mk postgresql-8.1beta3/src/backend/nls.mk +--- postgresql-8.1beta3-old/src/backend/nls.mk 2005-10-04 13:14:03.000000000 +0200 ++++ postgresql-8.1beta3/src/backend/nls.mk 2005-10-13 18:00:57.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/backend/nls.mk,v 1.20 2005/10/04 11:14:03 petere Exp $ +-CATALOG_NAME := postgres ++CATALOG_NAME := postgres-8.1 + AVAIL_LANGUAGES := af cs de es fr hr hu it ko nb pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := + gettext-files + # you can add "elog:2" and "errmsg_internal" to this list if you want to +diff -ruN postgresql-8.1beta3-old/src/bin/initdb/initdb.c postgresql-8.1beta3/src/bin/initdb/initdb.c +--- postgresql-8.1beta3-old/src/bin/initdb/initdb.c 2005-08-29 00:21:46.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/initdb/initdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -2220,7 +2220,7 @@ + }; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "initdb"); ++ set_pglocale_pgservice(argv[0], "initdb-8.1"); + + if (argc > 1) + { +diff -ruN postgresql-8.1beta3-old/src/bin/initdb/nls.mk postgresql-8.1beta3/src/bin/initdb/nls.mk +--- postgresql-8.1beta3-old/src/bin/initdb/nls.mk 2005-01-09 18:38:18.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/initdb/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/initdb/nls.mk,v 1.18 2005/01/09 17:38:18 petere Exp $ +-CATALOG_NAME := initdb ++CATALOG_NAME := initdb-8.1 + AVAIL_LANGUAGES := cs de es fr it ko pl pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := initdb.c ../../port/dirmod.c ../../port/exec.c + GETTEXT_TRIGGERS:= _ simple_prompt +diff -ruN postgresql-8.1beta3-old/src/bin/pg_config/nls.mk postgresql-8.1beta3/src/bin/pg_config/nls.mk +--- postgresql-8.1beta3-old/src/bin/pg_config/nls.mk 2005-01-09 18:38:19.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/pg_config/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/pg_config/nls.mk,v 1.15 2005/01/09 17:38:19 petere Exp $ +-CATALOG_NAME := pg_config ++CATALOG_NAME := pg_config-8.1 + AVAIL_LANGUAGES := cs de es fr ko pl pt_BR ro ru sl sv tr zh_CN zh_TW + GETTEXT_FILES := pg_config.c ../../port/exec.c + GETTEXT_TRIGGERS:= _ +diff -ruN postgresql-8.1beta3-old/src/bin/pg_config/pg_config.c postgresql-8.1beta3/src/bin/pg_config/pg_config.c +--- postgresql-8.1beta3-old/src/bin/pg_config/pg_config.c 2005-10-06 14:04:58.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_config/pg_config.c 2005-10-13 18:00:42.000000000 +0200 +@@ -479,7 +479,7 @@ + int j; + int ret; + +- set_pglocale_pgservice(argv[0], "pg_config"); ++ set_pglocale_pgservice(argv[0], "pg_config-8.1"); + + progname = get_progname(argv[0]); + +diff -ruN postgresql-8.1beta3-old/src/bin/pg_controldata/nls.mk postgresql-8.1beta3/src/bin/pg_controldata/nls.mk +--- postgresql-8.1beta3-old/src/bin/pg_controldata/nls.mk 2005-01-14 09:57:05.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/pg_controldata/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/pg_controldata/nls.mk,v 1.16 2005/01/14 08:57:05 petere Exp $ +-CATALOG_NAME := pg_controldata ++CATALOG_NAME := pg_controldata-8.1 + AVAIL_LANGUAGES := cs de es fa fr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := pg_controldata.c + GETTEXT_TRIGGERS:= _ +diff -ruN postgresql-8.1beta3-old/src/bin/pg_controldata/pg_controldata.c postgresql-8.1beta3/src/bin/pg_controldata/pg_controldata.c +--- postgresql-8.1beta3-old/src/bin/pg_controldata/pg_controldata.c 2005-10-03 02:28:41.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_controldata/pg_controldata.c 2005-10-13 18:00:42.000000000 +0200 +@@ -73,7 +73,7 @@ + char *strftime_fmt = "%c"; + const char *progname; + +- set_pglocale_pgservice(argv[0], "pg_controldata"); ++ set_pglocale_pgservice(argv[0], "pg_controldata-8.1"); + + progname = get_progname(argv[0]); + +diff -ruN postgresql-8.1beta3-old/src/bin/pg_ctl/nls.mk postgresql-8.1beta3/src/bin/pg_ctl/nls.mk +--- postgresql-8.1beta3-old/src/bin/pg_ctl/nls.mk 2004-12-16 12:27:41.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/pg_ctl/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/pg_ctl/nls.mk,v 1.15 2004/12/16 11:27:41 petere Exp $ +-CATALOG_NAME := pg_ctl ++CATALOG_NAME := pg_ctl-8.1 + AVAIL_LANGUAGES := cs de es fr ko pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := pg_ctl.c ../../port/exec.c + GETTEXT_TRIGGERS:= _ simple_prompt +diff -ruN postgresql-8.1beta3-old/src/bin/pg_ctl/pg_ctl.c postgresql-8.1beta3/src/bin/pg_ctl/pg_ctl.c +--- postgresql-8.1beta3-old/src/bin/pg_ctl/pg_ctl.c 2005-07-25 06:52:32.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_ctl/pg_ctl.c 2005-10-13 18:00:42.000000000 +0200 +@@ -1291,7 +1291,7 @@ + #endif + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pg_ctl"); ++ set_pglocale_pgservice(argv[0], "pg_ctl-8.1"); + + /* + * save argv[0] so do_start() can look for the postmaster if +diff -ruN postgresql-8.1beta3-old/src/bin/pg_dump/nls.mk postgresql-8.1beta3/src/bin/pg_dump/nls.mk +--- postgresql-8.1beta3-old/src/bin/pg_dump/nls.mk 2005-01-25 18:32:00.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/pg_dump/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/pg_dump/nls.mk,v 1.19 2005/01/25 17:32:00 petere Exp $ +-CATALOG_NAME := pg_dump ++CATALOG_NAME := pg_dump-8.1 + AVAIL_LANGUAGES := cs de es fr it ko nb pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := pg_dump.c common.c pg_backup_archiver.c pg_backup_custom.c \ + pg_backup_db.c pg_backup_files.c pg_backup_null.c \ +diff -ruN postgresql-8.1beta3-old/src/bin/pg_dump/pg_dumpall.c postgresql-8.1beta3/src/bin/pg_dump/pg_dumpall.c +--- postgresql-8.1beta3-old/src/bin/pg_dump/pg_dumpall.c 2005-10-11 00:29:48.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_dump/pg_dumpall.c 2005-10-13 18:00:42.000000000 +0200 +@@ -119,7 +119,7 @@ + + int optindex; + +- set_pglocale_pgservice(argv[0], "pg_dump"); ++ set_pglocale_pgservice(argv[0], "pg_dump-8.1"); + + progname = get_progname(argv[0]); + +diff -ruN postgresql-8.1beta3-old/src/bin/pg_dump/pg_dump.c postgresql-8.1beta3/src/bin/pg_dump/pg_dump.c +--- postgresql-8.1beta3-old/src/bin/pg_dump/pg_dump.c 2005-09-21 21:58:02.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_dump/pg_dump.c 2005-10-13 18:00:42.000000000 +0200 +@@ -250,7 +250,7 @@ + }; + int optindex; + +- set_pglocale_pgservice(argv[0], "pg_dump"); ++ set_pglocale_pgservice(argv[0], "pg_dump-8.1"); + + g_verbose = false; + +diff -ruN postgresql-8.1beta3-old/src/bin/pg_dump/pg_restore.c postgresql-8.1beta3/src/bin/pg_dump/pg_restore.c +--- postgresql-8.1beta3-old/src/bin/pg_dump/pg_restore.c 2005-09-28 15:11:26.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_dump/pg_restore.c 2005-10-13 18:00:42.000000000 +0200 +@@ -122,7 +122,7 @@ + {NULL, 0, NULL, 0} + }; + +- set_pglocale_pgservice(argv[0], "pg_dump"); ++ set_pglocale_pgservice(argv[0], "pg_dump-8.1"); + + opts = NewRestoreOptions(); + +diff -ruN postgresql-8.1beta3-old/src/bin/pg_resetxlog/nls.mk postgresql-8.1beta3/src/bin/pg_resetxlog/nls.mk +--- postgresql-8.1beta3-old/src/bin/pg_resetxlog/nls.mk 2004-12-16 12:27:42.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/pg_resetxlog/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/pg_resetxlog/nls.mk,v 1.17 2004/12/16 11:27:42 petere Exp $ +-CATALOG_NAME := pg_resetxlog ++CATALOG_NAME := pg_resetxlog-8.1 + AVAIL_LANGUAGES := cs de es fr hu it ko nb pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := pg_resetxlog.c + GETTEXT_TRIGGERS:= _ +diff -ruN postgresql-8.1beta3-old/src/bin/pg_resetxlog/pg_resetxlog.c postgresql-8.1beta3/src/bin/pg_resetxlog/pg_resetxlog.c +--- postgresql-8.1beta3-old/src/bin/pg_resetxlog/pg_resetxlog.c 2005-10-03 02:28:42.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/pg_resetxlog/pg_resetxlog.c 2005-10-13 18:00:42.000000000 +0200 +@@ -85,7 +85,7 @@ + int fd; + char path[MAXPGPATH]; + +- set_pglocale_pgservice(argv[0], "pg_resetxlog"); ++ set_pglocale_pgservice(argv[0], "pg_resetxlog-8.1"); + + progname = get_progname(argv[0]); + +diff -ruN postgresql-8.1beta3-old/src/bin/psql/nls.mk postgresql-8.1beta3/src/bin/psql/nls.mk +--- postgresql-8.1beta3-old/src/bin/psql/nls.mk 2004-12-13 17:30:48.000000000 +0100 ++++ postgresql-8.1beta3/src/bin/psql/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/psql/nls.mk,v 1.21 2004/12/13 16:30:48 petere Exp $ +-CATALOG_NAME := psql ++CATALOG_NAME := psql-8.1 + AVAIL_LANGUAGES := cs de es fa fr hu it ko nb pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := command.c common.c copy.c help.c input.c large_obj.c \ + mainloop.c print.c startup.c describe.c sql_help.h \ +diff -ruN postgresql-8.1beta3-old/src/bin/psql/startup.c postgresql-8.1beta3/src/bin/psql/startup.c +--- postgresql-8.1beta3-old/src/bin/psql/startup.c 2005-10-04 21:01:18.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/psql/startup.c 2005-10-13 18:00:42.000000000 +0200 +@@ -110,7 +110,7 @@ + char *password_prompt = NULL; + bool need_pass; + +- set_pglocale_pgservice(argv[0], "psql"); ++ set_pglocale_pgservice(argv[0], "psql-8.1"); + + if (argc > 1) + { +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/clusterdb.c postgresql-8.1beta3/src/bin/scripts/clusterdb.c +--- postgresql-8.1beta3-old/src/bin/scripts/clusterdb.c 2005-06-21 06:02:33.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/clusterdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -56,7 +56,7 @@ + char *table = NULL; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "clusterdb", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/createdb.c postgresql-8.1beta3/src/bin/scripts/createdb.c +--- postgresql-8.1beta3-old/src/bin/scripts/createdb.c 2005-06-21 06:02:33.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/createdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -60,7 +60,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "createdb", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/createlang.c postgresql-8.1beta3/src/bin/scripts/createlang.c +--- postgresql-8.1beta3-old/src/bin/scripts/createlang.c 2005-09-06 01:50:49.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/createlang.c 2005-10-13 18:00:42.000000000 +0200 +@@ -53,7 +53,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "createlang", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/createuser.c postgresql-8.1beta3/src/bin/scripts/createuser.c +--- postgresql-8.1beta3-old/src/bin/scripts/createuser.c 2005-09-30 09:58:01.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/createuser.c 2005-10-13 18:00:42.000000000 +0200 +@@ -75,7 +75,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "createuser", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/dropdb.c postgresql-8.1beta3/src/bin/scripts/dropdb.c +--- postgresql-8.1beta3-old/src/bin/scripts/dropdb.c 2005-06-21 06:02:33.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/dropdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -51,7 +51,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "dropdb", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/droplang.c postgresql-8.1beta3/src/bin/scripts/droplang.c +--- postgresql-8.1beta3-old/src/bin/scripts/droplang.c 2005-08-15 23:02:26.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/droplang.c 2005-10-13 18:00:42.000000000 +0200 +@@ -63,7 +63,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "droplang", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/dropuser.c postgresql-8.1beta3/src/bin/scripts/dropuser.c +--- postgresql-8.1beta3-old/src/bin/scripts/dropuser.c 2005-09-30 09:58:01.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/dropuser.c 2005-10-13 18:00:42.000000000 +0200 +@@ -51,7 +51,7 @@ + PGresult *result; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "dropuser", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/nls.mk postgresql-8.1beta3/src/bin/scripts/nls.mk +--- postgresql-8.1beta3-old/src/bin/scripts/nls.mk 2005-07-29 17:13:11.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/nls.mk 2005-10-13 18:00:42.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/bin/scripts/nls.mk,v 1.19 2005/07/29 15:13:11 momjian Exp $ +-CATALOG_NAME := pgscripts ++CATALOG_NAME := pgscripts-8.1 + AVAIL_LANGUAGES := cs de es fr it ko pt_BR ro ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := createdb.c createlang.c createuser.c \ + dropdb.c droplang.c dropuser.c \ +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/reindexdb.c postgresql-8.1beta3/src/bin/scripts/reindexdb.c +--- postgresql-8.1beta3-old/src/bin/scripts/reindexdb.c 2005-09-30 11:56:26.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/reindexdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -65,7 +65,7 @@ + const char *index = NULL; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "reindexdb", help); + +diff -ruN postgresql-8.1beta3-old/src/bin/scripts/vacuumdb.c postgresql-8.1beta3/src/bin/scripts/vacuumdb.c +--- postgresql-8.1beta3-old/src/bin/scripts/vacuumdb.c 2005-06-21 06:02:33.000000000 +0200 ++++ postgresql-8.1beta3/src/bin/scripts/vacuumdb.c 2005-10-13 18:00:42.000000000 +0200 +@@ -64,7 +64,7 @@ + bool verbose = false; + + progname = get_progname(argv[0]); +- set_pglocale_pgservice(argv[0], "pgscripts"); ++ set_pglocale_pgservice(argv[0], "pgscripts-8.1"); + + handle_help_version_opts(argc, argv, "vacuumdb", help); + +diff -ruN postgresql-8.1beta3-old/src/interfaces/libpq/fe-misc.c postgresql-8.1beta3/src/interfaces/libpq/fe-misc.c +--- postgresql-8.1beta3-old/src/interfaces/libpq/fe-misc.c 2005-09-26 19:49:09.000000000 +0200 ++++ postgresql-8.1beta3/src/interfaces/libpq/fe-misc.c 2005-10-13 18:00:43.000000000 +0200 +@@ -1145,7 +1145,7 @@ + ldir = getenv("PGLOCALEDIR"); + if (!ldir) + ldir = LOCALEDIR; +- bindtextdomain("libpq", ldir); ++ bindtextdomain("libpq4", ldir); + #ifdef WIN32 + SetLastError(save_errno); + #else +diff -ruN postgresql-8.1beta3-old/src/interfaces/libpq/nls.mk postgresql-8.1beta3/src/interfaces/libpq/nls.mk +--- postgresql-8.1beta3-old/src/interfaces/libpq/nls.mk 2005-01-14 09:57:06.000000000 +0100 ++++ postgresql-8.1beta3/src/interfaces/libpq/nls.mk 2005-10-13 18:00:43.000000000 +0200 +@@ -1,5 +1,5 @@ + # $PostgreSQL: pgsql/src/interfaces/libpq/nls.mk,v 1.20 2005/01/14 08:57:06 petere Exp $ +-CATALOG_NAME := libpq ++CATALOG_NAME := libpq4 + AVAIL_LANGUAGES := af cs de es fr hr it ko nb pl pt_BR ru sk sl sv tr zh_CN zh_TW + GETTEXT_FILES := fe-auth.c fe-connect.c fe-exec.c fe-lobj.c fe-misc.c fe-protocol2.c fe-protocol3.c fe-secure.c + GETTEXT_TRIGGERS:= libpq_gettext pqInternalNotice:2 --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-table-plan-consistency.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-table-plan-consistency.patch @@ -0,0 +1,712 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.174.2.3;r2=1.174.2.4 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execQual.c.diff?r1=1.183.2.4;r2=1.183.2.5 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execScan.c.diff?r1=1.37.2.1;r2=1.37.2.2 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execUtils.c.diff?r1=1.126.2.3;r2=1.126.2.4 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeAgg.c.diff?r1=1.135.2.1;r2=1.135.2.2 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeGroup.c.diff?r1=1.62;r2=1.62.2.1 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHashjoin.c.diff?r1=1.75.2.3;r2=1.75.2.4 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c.diff?r1=1.75.2.2;r2=1.75.2.3 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeNestloop.c.diff?r1=1.39.2.1;r2=1.39.2.2 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeResult.c.diff?r1=1.32.2.1;r2=1.32.2.2 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSubplan.c.diff?r1=1.70.2.1;r2=1.70.2.2 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/executor.h.diff?r1=1.120.2.2;r2=1.120.2.3 + +Repair failure to check that a table is still compatible with a previously +made query plan. Use of ALTER COLUMN TYPE creates a hazard for cached +query plans: they could contain Vars that claim a column has a different +type than it now has. Fix this by checking during plan startup that Vars +at relation scan level match the current relation tuple descriptor. Since +at that point we already have at least AccessShareLock, we can be sure the +column type will not change underneath us later in the query. However, +since a backend's locks do not conflict against itself, there is still a +hole for an attacker to exploit: he could try to execute ALTER COLUMN TYPE +while a query is in progress in the current backend. Seal that hole by +rejecting ALTER TABLE whenever the target relation is already open in +the current backend. + +This is a significant security hole: not only can one trivially crash the +backend, but with appropriate misuse of pass-by-reference datatypes it is +possible to read out arbitrary locations in the server process's memory, +which could allow retrieving database content the user should not be able +to see. Our thanks to Jeff Trout for the initial report. + +Security: CVE-2007-0556 + +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/commands/tablecmds.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/commands/tablecmds.c +--- postgresql-8.1.4/src/backend/commands/tablecmds.c 2006-01-30 17:19:04.000000000 +0100 ++++ postgresql-8.1.4/src/backend/commands/tablecmds.c 2007-02-05 08:47:51.000000000 +0100 +@@ -1798,22 +1798,47 @@ + void + AlterTable(AlterTableStmt *stmt) + { +- ATController(relation_openrv(stmt->relation, AccessExclusiveLock), +- stmt->cmds, +- interpretInhOption(stmt->relation->inhOpt)); ++ Relation rel = relation_openrv(stmt->relation, AccessExclusiveLock); ++ int expected_refcnt; ++ ++ /* ++ * Disallow ALTER TABLE when the current backend has any open reference ++ * to it besides the one we just got (such as an open cursor or active ++ * plan); our AccessExclusiveLock doesn't protect us against stomping on ++ * our own foot, only other people's feet! ++ * ++ * Note: the only case known to cause serious trouble is ALTER COLUMN TYPE, ++ * and some changes are obviously pretty benign, so this could possibly ++ * be relaxed to only error out for certain types of alterations. But ++ * the use-case for allowing any of these things is not obvious, so we ++ * won't work hard at it for now. ++ */ ++ expected_refcnt = rel->rd_isnailed ? 2 : 1; ++ if (rel->rd_refcnt != expected_refcnt) ++ ereport(ERROR, ++ (errcode(ERRCODE_OBJECT_IN_USE), ++ errmsg("relation \"%s\" is being used by active queries in this session", ++ RelationGetRelationName(rel)))); ++ ++ ATController(rel, stmt->cmds, interpretInhOption(stmt->relation->inhOpt)); + } + + /* + * AlterTableInternal + * + * ALTER TABLE with target specified by OID ++ * ++ * We do not reject if the relation is already open, because it's quite ++ * likely that one or more layers of caller have it open. That means it ++ * is unsafe to use this entry point for alterations that could break ++ * existing query plans. + */ + void + AlterTableInternal(Oid relid, List *cmds, bool recurse) + { +- ATController(relation_open(relid, AccessExclusiveLock), +- cmds, +- recurse); ++ Relation rel = relation_open(relid, AccessExclusiveLock); ++ ++ ATController(rel, cmds, recurse); + } + + static void +@@ -2705,6 +2730,12 @@ + if (childrelid == relid) + continue; + childrel = relation_open(childrelid, AccessExclusiveLock); ++ /* check for child relation in use in this session */ ++ if (childrel->rd_refcnt != 1) ++ ereport(ERROR, ++ (errcode(ERRCODE_OBJECT_IN_USE), ++ errmsg("relation \"%s\" is being used by active queries in this session", ++ RelationGetRelationName(childrel)))); + ATPrepCmd(wqueue, childrel, cmd, false, true); + relation_close(childrel, NoLock); + } +@@ -2736,6 +2767,12 @@ + Relation childrel; + + childrel = relation_open(childrelid, AccessExclusiveLock); ++ /* check for child relation in use in this session */ ++ if (childrel->rd_refcnt != 1) ++ ereport(ERROR, ++ (errcode(ERRCODE_OBJECT_IN_USE), ++ errmsg("relation \"%s\" is being used by active queries in this session", ++ RelationGetRelationName(childrel)))); + ATPrepCmd(wqueue, childrel, cmd, true, true); + relation_close(childrel, NoLock); + } +@@ -3563,6 +3600,12 @@ + Form_pg_attribute childatt; + + childrel = heap_open(childrelid, AccessExclusiveLock); ++ /* check for child relation in use in this session */ ++ if (childrel->rd_refcnt != 1) ++ ereport(ERROR, ++ (errcode(ERRCODE_OBJECT_IN_USE), ++ errmsg("relation \"%s\" is being used by active queries in this session", ++ RelationGetRelationName(childrel)))); + + tuple = SearchSysCacheCopyAttName(childrelid, colName); + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/execQual.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/execQual.c +--- postgresql-8.1.4/src/backend/executor/execQual.c 2006-03-10 02:51:34.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/execQual.c 2007-02-05 08:47:51.000000000 +0100 +@@ -64,6 +64,8 @@ + bool *isNull, ExprDoneCond *isDone); + static Datum ExecEvalVar(ExprState *exprstate, ExprContext *econtext, + bool *isNull, ExprDoneCond *isDone); ++static Datum ExecEvalScalarVar(ExprState *exprstate, ExprContext *econtext, ++ bool *isNull, ExprDoneCond *isDone); + static Datum ExecEvalWholeRowVar(ExprState *exprstate, ExprContext *econtext, + bool *isNull, ExprDoneCond *isDone); + static Datum ExecEvalConst(ExprState *exprstate, ExprContext *econtext, +@@ -434,6 +436,10 @@ + * + * Returns a Datum whose value is the value of a range + * variable with respect to given expression context. ++ * ++ * Note: ExecEvalVar is executed only the first time through in a given plan; ++ * it changes the ExprState's function pointer to pass control directly to ++ * ExecEvalScalarVar or ExecEvalWholeRowVar after making one-time checks. + * ---------------------------------------------------------------- + */ + static Datum +@@ -448,7 +454,7 @@ + *isDone = ExprSingleResult; + + /* +- * Get the slot and attribute number we want ++ * Get the input slot and attribute number we want + * + * The asserts check that references to system attributes only appear at + * the level of a relation scan; at higher levels, system attributes must +@@ -475,35 +481,168 @@ + break; + } + +-#ifdef USE_ASSERT_CHECKING +- +- /* +- * Some checks that are only applied for user attribute numbers (bogus +- * system attnums will be caught inside slot_getattr). +- */ +- if (attnum > 0) ++ if (attnum != InvalidAttrNumber) + { +- TupleDesc tuple_type = slot->tts_tupleDescriptor; +- + /* +- * This assert checks that the attnum is valid. ++ * Scalar variable case. ++ * ++ * If it's a user attribute, check validity (bogus system attnums will ++ * be caught inside slot_getattr). What we have to check for here ++ * is the possibility of an attribute having been changed in type ++ * since the plan tree was created. Ideally the plan would get ++ * invalidated and not re-used, but until that day arrives, we need ++ * defenses. Fortunately it's sufficient to check once on the first ++ * time through. ++ * ++ * Note: we allow a reference to a dropped attribute. slot_getattr ++ * will force a NULL result in such cases. ++ * ++ * Note: we check typmod, but allow the case that the Var has ++ * unspecified typmod while the column has a specific typmod. + */ +- Assert(attnum <= tuple_type->natts); ++ if (attnum > 0) ++ { ++ TupleDesc slot_tupdesc = slot->tts_tupleDescriptor; ++ Form_pg_attribute attr; ++ ++ if (attnum > slot_tupdesc->natts) /* should never happen */ ++ elog(ERROR, "attribute number %d exceeds number of columns %d", ++ attnum, slot_tupdesc->natts); ++ ++ attr = slot_tupdesc->attrs[attnum - 1]; + ++ /* can't check type if dropped, since atttypid is probably 0 */ ++ if (!attr->attisdropped) ++ { ++ if (variable->vartype != attr->atttypid || ++ (variable->vartypmod != attr->atttypmod && ++ variable->vartypmod != -1)) ++ ereport(ERROR, ++ (errmsg("attribute %d has wrong type", attnum), ++ errdetail("Table has type %s, but query expects %s.", ++ format_type_be(attr->atttypid), ++ format_type_be(variable->vartype)))); ++ } ++ } ++ ++ /* Skip the checking on future executions of node */ ++ exprstate->evalfunc = ExecEvalScalarVar; ++ ++ /* Fetch the value from the slot */ ++ return slot_getattr(slot, attnum, isNull); ++ } ++ else ++ { + /* +- * This assert checks that the datatype the plan expects to get (as +- * told by our "variable" argument) is in fact the datatype of the +- * attribute being fetched (as seen in the current context, identified +- * by our "econtext" argument). Otherwise crashes are likely. ++ * Whole-row variable. + * +- * Note that we can't check dropped columns, since their atttypid has +- * been zeroed. ++ * If it's a RECORD Var, we'll use the slot's type ID info. It's ++ * likely that the slot's type is also RECORD; if so, make sure it's ++ * been "blessed", so that the Datum can be interpreted later. ++ * ++ * If the Var identifies a named composite type, we must check that ++ * the actual tuple type is compatible with it. + */ +- Assert(variable->vartype == tuple_type->attrs[attnum - 1]->atttypid || +- tuple_type->attrs[attnum - 1]->attisdropped); ++ TupleDesc slot_tupdesc = slot->tts_tupleDescriptor; ++ ++ if (variable->vartype == RECORDOID) ++ { ++ if (slot_tupdesc->tdtypeid == RECORDOID && ++ slot_tupdesc->tdtypmod < 0) ++ assign_record_type_typmod(slot_tupdesc); ++ } ++ else ++ { ++ TupleDesc var_tupdesc; ++ int i; ++ ++ /* ++ * We really only care about number of attributes and data type. ++ * Also, we can ignore type mismatch on columns that are dropped ++ * in the destination type, so long as the physical storage ++ * matches. This is helpful in some cases involving out-of-date ++ * cached plans. ++ */ ++ var_tupdesc = lookup_rowtype_tupdesc(variable->vartype, -1); ++ ++ if (var_tupdesc->natts != slot_tupdesc->natts) ++ ereport(ERROR, ++ (errcode(ERRCODE_DATATYPE_MISMATCH), ++ errmsg("table row type and query-specified row type do not match"), ++ errdetail("Table row contains %d attributes, but query expects %d.", ++ slot_tupdesc->natts, var_tupdesc->natts))); ++ ++ for (i = 0; i < var_tupdesc->natts; i++) ++ { ++ Form_pg_attribute vattr = var_tupdesc->attrs[i]; ++ Form_pg_attribute sattr = slot_tupdesc->attrs[i]; ++ ++ if (vattr->atttypid == sattr->atttypid) ++ continue; /* no worries */ ++ if (!vattr->attisdropped) ++ ereport(ERROR, ++ (errcode(ERRCODE_DATATYPE_MISMATCH), ++ errmsg("table row type and query-specified row type do not match"), ++ errdetail("Table has type %s at ordinal position %d, but query expects %s.", ++ format_type_be(sattr->atttypid), ++ i + 1, ++ format_type_be(vattr->atttypid)))); ++ ++ if (vattr->attlen != sattr->attlen || ++ vattr->attalign != sattr->attalign) ++ ereport(ERROR, ++ (errcode(ERRCODE_DATATYPE_MISMATCH), ++ errmsg("table row type and query-specified row type do not match"), ++ errdetail("Physical storage mismatch on dropped attribute at ordinal position %d.", ++ i + 1))); ++ } ++ } ++ ++ /* Skip the checking on future executions of node */ ++ exprstate->evalfunc = ExecEvalWholeRowVar; ++ ++ /* Fetch the value */ ++ return ExecEvalWholeRowVar(exprstate, econtext, isNull, isDone); ++ } ++} ++ ++/* ---------------------------------------------------------------- ++ * ExecEvalScalarVar ++ * ++ * Returns a Datum for a scalar variable. ++ * ---------------------------------------------------------------- ++ */ ++static Datum ++ExecEvalScalarVar(ExprState *exprstate, ExprContext *econtext, ++ bool *isNull, ExprDoneCond *isDone) ++{ ++ Var *variable = (Var *) exprstate->expr; ++ TupleTableSlot *slot; ++ AttrNumber attnum; ++ ++ if (isDone) ++ *isDone = ExprSingleResult; ++ ++ /* Get the input slot and attribute number we want */ ++ switch (variable->varno) ++ { ++ case INNER: /* get the tuple from the inner node */ ++ slot = econtext->ecxt_innertuple; ++ break; ++ ++ case OUTER: /* get the tuple from the outer node */ ++ slot = econtext->ecxt_outertuple; ++ break; ++ ++ default: /* get the tuple from the relation being ++ * scanned */ ++ slot = econtext->ecxt_scantuple; ++ break; + } +-#endif /* USE_ASSERT_CHECKING */ + ++ attnum = variable->varattno; ++ ++ /* Fetch the value from the slot */ + return slot_getattr(slot, attnum, isNull); + } + +@@ -511,10 +650,6 @@ + * ExecEvalWholeRowVar + * + * Returns a Datum for a whole-row variable. +- * +- * This could be folded into ExecEvalVar, but we make it a separate +- * routine so as not to slow down ExecEvalVar with tests for this +- * uncommon case. + * ---------------------------------------------------------------- + */ + static Datum +@@ -522,7 +657,7 @@ + bool *isNull, ExprDoneCond *isDone) + { + Var *variable = (Var *) exprstate->expr; +- TupleTableSlot *slot; ++ TupleTableSlot *slot = econtext->ecxt_scantuple; + HeapTuple tuple; + TupleDesc tupleDesc; + HeapTupleHeader dtuple; +@@ -531,16 +666,6 @@ + *isDone = ExprSingleResult; + *isNull = false; + +- Assert(variable->varattno == InvalidAttrNumber); +- +- /* +- * Whole-row Vars can only appear at the level of a relation scan, never +- * in a join. +- */ +- Assert(variable->varno != INNER); +- Assert(variable->varno != OUTER); +- slot = econtext->ecxt_scantuple; +- + tuple = ExecFetchSlotTuple(slot); + tupleDesc = slot->tts_tupleDescriptor; + +@@ -556,9 +681,6 @@ + /* + * If the Var identifies a named composite type, label the tuple with that + * type; otherwise use what is in the tupleDesc. +- * +- * It's likely that the slot's tupleDesc is a record type; if so, make +- * sure it's been "blessed", so that the Datum can be interpreted later. + */ + if (variable->vartype != RECORDOID) + { +@@ -567,9 +689,6 @@ + } + else + { +- if (tupleDesc->tdtypeid == RECORDOID && +- tupleDesc->tdtypmod < 0) +- assign_record_type_typmod(tupleDesc); + HeapTupleHeaderSetTypeId(dtuple, tupleDesc->tdtypeid); + HeapTupleHeaderSetTypMod(dtuple, tupleDesc->tdtypmod); + } +@@ -2667,12 +2786,14 @@ + ExprDoneCond *isDone) + { + FieldSelect *fselect = (FieldSelect *) fstate->xprstate.expr; ++ AttrNumber fieldnum = fselect->fieldnum; + Datum result; + Datum tupDatum; + HeapTupleHeader tuple; + Oid tupType; + int32 tupTypmod; + TupleDesc tupDesc; ++ Form_pg_attribute attr; + HeapTupleData tmptup; + + tupDatum = ExecEvalExpr(fstate->arg, econtext, isNull, isDone); +@@ -2704,6 +2825,28 @@ + MemoryContextSwitchTo(oldcontext); + } + ++ /* Check for dropped column, and force a NULL result if so */ ++ if (fieldnum <= 0 || ++ fieldnum > tupDesc->natts) /* should never happen */ ++ elog(ERROR, "attribute number %d exceeds number of columns %d", ++ fieldnum, tupDesc->natts); ++ attr = tupDesc->attrs[fieldnum - 1]; ++ if (attr->attisdropped) ++ { ++ *isNull = true; ++ return (Datum) 0; ++ } ++ ++ /* Check for type mismatch --- possible after ALTER COLUMN TYPE? */ ++ if (fselect->resulttype != attr->atttypid || ++ (fselect->resulttypmod != attr->atttypmod && ++ fselect->resulttypmod != -1)) ++ ereport(ERROR, ++ (errmsg("attribute %d has wrong type", fieldnum), ++ errdetail("Table has type %s, but query expects %s.", ++ format_type_be(attr->atttypid), ++ format_type_be(fselect->resulttype)))); ++ + /* + * heap_getattr needs a HeapTuple not a bare HeapTupleHeader. We set all + * the fields in the struct just in case user tries to inspect system +@@ -2715,7 +2858,7 @@ + tmptup.t_data = tuple; + + result = heap_getattr(&tmptup, +- fselect->fieldnum, ++ fieldnum, + tupDesc, + isNull); + return result; +@@ -2915,15 +3058,8 @@ + switch (nodeTag(node)) + { + case T_Var: +- { +- Var *var = (Var *) node; +- +- state = (ExprState *) makeNode(ExprState); +- if (var->varattno != InvalidAttrNumber) +- state->evalfunc = ExecEvalVar; +- else +- state->evalfunc = ExecEvalWholeRowVar; +- } ++ state = (ExprState *) makeNode(ExprState); ++ state->evalfunc = ExecEvalVar; + break; + case T_Const: + state = (ExprState *) makeNode(ExprState); +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/execScan.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/execScan.c +--- postgresql-8.1.4/src/backend/executor/execScan.c 2005-10-15 04:49:16.000000000 +0200 ++++ postgresql-8.1.4/src/backend/executor/execScan.c 2007-02-05 08:48:53.000000000 +0100 +@@ -187,7 +187,8 @@ + node->ss_ScanTupleSlot->tts_tupleDescriptor)) + node->ps.ps_ProjInfo = NULL; + else +- ExecAssignProjectionInfo(&node->ps); ++ ExecAssignProjectionInfo(&node->ps, ++ node->ss_ScanTupleSlot->tts_tupleDescriptor); + } + + static bool +@@ -209,14 +210,17 @@ + var = (Var *) ((TargetEntry *) lfirst(tlist_item))->expr; + if (!var || !IsA(var, Var)) + return false; /* tlist item not a Var */ ++ /* if these Asserts fail, planner messed up */ + Assert(var->varno == varno); + Assert(var->varlevelsup == 0); + if (var->varattno != attrno) + return false; /* out of order */ + if (att_tup->attisdropped) + return false; /* table contains dropped columns */ +- Assert(var->vartype == att_tup->atttypid); +- Assert(var->vartypmod == att_tup->atttypmod); ++ if (var->vartype != att_tup->atttypid || ++ (var->vartypmod != att_tup->atttypmod && ++ var->vartypmod != -1)) ++ return false; /* type mismatch */ + + tlist_item = lnext(tlist_item); + } +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/execUtils.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/execUtils.c +--- postgresql-8.1.4/src/backend/executor/execUtils.c 2005-11-23 21:28:04.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/execUtils.c 2007-02-05 08:47:51.000000000 +0100 +@@ -483,12 +483,19 @@ + * econtext, and storing the result into the tuple slot. (Caller must have + * ensured that tuple slot has a descriptor matching the tlist!) Note that + * the given tlist should be a list of ExprState nodes, not Expr nodes. ++ * ++ * inputDesc can be NULL, but if it is not, we check to see whether simple ++ * Vars in the tlist match the descriptor. It is important to provide ++ * inputDesc for relation-scan plan nodes, as a cross check that the relation ++ * hasn't been changed since the plan was made. At higher levels of a plan, ++ * there is no need to recheck. + * ---------------- + */ + ProjectionInfo * + ExecBuildProjectionInfo(List *targetList, + ExprContext *econtext, +- TupleTableSlot *slot) ++ TupleTableSlot *slot, ++ TupleDesc inputDesc) + { + ProjectionInfo *projInfo = makeNode(ProjectionInfo); + int len; +@@ -503,14 +510,17 @@ + + /* + * Determine whether the target list consists entirely of simple Var +- * references (ie, references to non-system attributes). If so, we can +- * use the simpler ExecVariableList instead of ExecTargetList. ++ * references (ie, references to non-system attributes) that match the ++ * input. If so, we can use the simpler ExecVariableList instead of ++ * ExecTargetList. (Note: if there is a type mismatch then ExecEvalVar ++ * will probably throw an error at runtime, but we leave that to it.) + */ + isVarList = true; + foreach(tl, targetList) + { + GenericExprState *gstate = (GenericExprState *) lfirst(tl); + Var *variable = (Var *) gstate->arg->expr; ++ Form_pg_attribute attr; + + if (variable == NULL || + !IsA(variable, Var) || +@@ -519,6 +529,22 @@ + isVarList = false; + break; + } ++ if (!inputDesc) ++ continue; /* can't check type, assume OK */ ++ if (variable->varattno > inputDesc->natts) ++ { ++ isVarList = false; ++ break; ++ } ++ attr = inputDesc->attrs[variable->varattno - 1]; ++ if (attr->attisdropped || ++ variable->vartype != attr->atttypid || ++ (variable->vartypmod != attr->atttypmod && ++ variable->vartypmod != -1)) ++ { ++ isVarList = false; ++ break; ++ } + } + projInfo->pi_isVarList = isVarList; + +@@ -594,15 +620,20 @@ + * ExecAssignProjectionInfo + * + * forms the projection information from the node's targetlist ++ * ++ * Notes for inputDesc are same as for ExecBuildProjectionInfo: supply it ++ * for a relation-scan node, can pass NULL for upper-level nodes + * ---------------- + */ + void +-ExecAssignProjectionInfo(PlanState *planstate) ++ExecAssignProjectionInfo(PlanState *planstate, ++ TupleDesc inputDesc) + { + planstate->ps_ProjInfo = + ExecBuildProjectionInfo(planstate->targetlist, + planstate->ps_ExprContext, +- planstate->ps_ResultTupleSlot); ++ planstate->ps_ResultTupleSlot, ++ inputDesc); + } + + +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeAgg.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeAgg.c +--- postgresql-8.1.4/src/backend/executor/nodeAgg.c 2005-11-22 19:23:09.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/nodeAgg.c 2007-02-05 08:47:51.000000000 +0100 +@@ -1120,7 +1120,7 @@ + * Initialize result tuple type and projection info. + */ + ExecAssignResultTypeFromTL(&aggstate->ss.ps); +- ExecAssignProjectionInfo(&aggstate->ss.ps); ++ ExecAssignProjectionInfo(&aggstate->ss.ps, NULL); + + /* + * get the count of aggregates in targetlist and quals +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeGroup.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeGroup.c +--- postgresql-8.1.4/src/backend/executor/nodeGroup.c 2005-10-15 04:49:17.000000000 +0200 ++++ postgresql-8.1.4/src/backend/executor/nodeGroup.c 2007-02-05 08:47:51.000000000 +0100 +@@ -203,7 +203,7 @@ + * Initialize result tuple type and projection info. + */ + ExecAssignResultTypeFromTL(&grpstate->ss.ps); +- ExecAssignProjectionInfo(&grpstate->ss.ps); ++ ExecAssignProjectionInfo(&grpstate->ss.ps, NULL); + + /* + * Precompute fmgr lookup data for inner loop +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeHashjoin.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeHashjoin.c +--- postgresql-8.1.4/src/backend/executor/nodeHashjoin.c 2005-11-29 00:46:24.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/nodeHashjoin.c 2007-02-05 08:47:51.000000000 +0100 +@@ -426,7 +426,7 @@ + * initialize tuple type and projection info + */ + ExecAssignResultTypeFromTL(&hjstate->js.ps); +- ExecAssignProjectionInfo(&hjstate->js.ps); ++ ExecAssignProjectionInfo(&hjstate->js.ps, NULL); + + ExecSetSlotDescriptor(hjstate->hj_OuterTupleSlot, + ExecGetResultType(outerPlanState(hjstate)), +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeMergejoin.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeMergejoin.c +--- postgresql-8.1.4/src/backend/executor/nodeMergejoin.c 2006-03-17 20:38:20.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/nodeMergejoin.c 2007-02-05 08:47:51.000000000 +0100 +@@ -1606,7 +1606,7 @@ + * initialize tuple type and projection info + */ + ExecAssignResultTypeFromTL(&mergestate->js.ps); +- ExecAssignProjectionInfo(&mergestate->js.ps); ++ ExecAssignProjectionInfo(&mergestate->js.ps, NULL); + + /* + * preprocess the merge clauses +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeNestloop.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeNestloop.c +--- postgresql-8.1.4/src/backend/executor/nodeNestloop.c 2005-11-22 19:23:09.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/nodeNestloop.c 2007-02-05 08:47:51.000000000 +0100 +@@ -339,7 +339,7 @@ + * initialize tuple type and projection info + */ + ExecAssignResultTypeFromTL(&nlstate->js.ps); +- ExecAssignProjectionInfo(&nlstate->js.ps); ++ ExecAssignProjectionInfo(&nlstate->js.ps, NULL); + + /* + * finally, wipe the current outer tuple clean. +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeResult.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeResult.c +--- postgresql-8.1.4/src/backend/executor/nodeResult.c 2005-10-15 04:49:17.000000000 +0200 ++++ postgresql-8.1.4/src/backend/executor/nodeResult.c 2007-02-05 08:47:51.000000000 +0100 +@@ -229,7 +229,7 @@ + * initialize tuple type and projection info + */ + ExecAssignResultTypeFromTL(&resstate->ps); +- ExecAssignProjectionInfo(&resstate->ps); ++ ExecAssignProjectionInfo(&resstate->ps, NULL); + + return resstate; + } +diff -Nur postgresql-8.1-8.1.4/build-tree/postgresql-8.1.4/src/backend/executor/nodeSubplan.c postgresql-8.1-8.1.4.new/build-tree/postgresql-8.1.4/src/backend/executor/nodeSubplan.c +--- postgresql-8.1.4/src/backend/executor/nodeSubplan.c 2005-11-22 19:23:09.000000000 +0100 ++++ postgresql-8.1.4/src/backend/executor/nodeSubplan.c 2007-02-05 08:47:51.000000000 +0100 +@@ -882,14 +882,16 @@ + ExecSetSlotDescriptor(slot, tupDesc, true); + node->projLeft = ExecBuildProjectionInfo(lefttlist, + NULL, +- slot); ++ slot, ++ NULL); + + tupDesc = ExecTypeFromTL(rightptlist, false); + slot = ExecAllocTableSlot(tupTable); + ExecSetSlotDescriptor(slot, tupDesc, true); + node->projRight = ExecBuildProjectionInfo(righttlist, + node->innerecontext, +- slot); ++ slot, ++ NULL); + } + } + +--- pgsql/src/include/executor/executor.h 2006/01/12 21:49:07 1.120.2.2 ++++ pgsql/src/include/executor/executor.h 2007/02/02 00:07:44 1.120.2.3 +@@ -222,8 +222,10 @@ extern void ExecAssignResultTypeFromTL(P + extern TupleDesc ExecGetResultType(PlanState *planstate); + extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList, + ExprContext *econtext, +- TupleTableSlot *slot); +-extern void ExecAssignProjectionInfo(PlanState *planstate); ++ TupleTableSlot *slot, ++ TupleDesc inputDesc); ++extern void ExecAssignProjectionInfo(PlanState *planstate, ++ TupleDesc inputDesc); + extern void ExecFreeExprContext(PlanState *planstate); + extern TupleDesc ExecGetScanType(ScanState *scanstate); + extern void ExecAssignScanType(ScanState *scanstate, + --- postgresql-8.1-8.1.4.orig/debian/patches/55-contrib-admin.patch +++ postgresql-8.1-8.1.4/debian/patches/55-contrib-admin.patch @@ -0,0 +1,530 @@ +diff -Nur postgresql-8.1.4/contrib/admin81/admin81.c postgresql-8.1.4.new/contrib/admin81/admin81.c +--- postgresql-8.1.4/contrib/admin81/admin81.c 1970-01-01 01:00:00.000000000 +0100 ++++ postgresql-8.1.4.new/contrib/admin81/admin81.c 2006-03-06 12:53:57.000000000 +0100 +@@ -0,0 +1,390 @@ ++/*------------------------------------------------------------------------- ++ * ++ * admin81.c ++ * ++ * ++ * Copyright (c) 2004 - 2006, PostgreSQL Global Development Group ++ * ++ * Author: Andreas Pflug ++ * ++ * IDENTIFICATION ++ * $PostgreSQL: $ ++ * ++ *------------------------------------------------------------------------- ++ */ ++#include "postgres.h" ++ ++#include ++#include ++#include ++#include ++ ++#include "miscadmin.h" ++#include "storage/fd.h" ++#include "catalog/pg_type.h" ++#include "funcapi.h" ++#include "utils/datetime.h" ++ ++ ++#ifdef WIN32 ++ ++#ifdef rename ++#undef rename ++#endif ++ ++#ifdef unlink ++#undef unlink ++#endif ++ ++#endif ++ ++extern DLLIMPORT char *DataDir; ++extern DLLIMPORT char *Log_directory; ++extern DLLIMPORT char *Log_filename; ++ ++Datum pg_file_write(PG_FUNCTION_ARGS); ++Datum pg_file_rename(PG_FUNCTION_ARGS); ++Datum pg_file_unlink(PG_FUNCTION_ARGS); ++Datum pg_logdir_ls(PG_FUNCTION_ARGS); ++ ++PG_FUNCTION_INFO_V1(pg_file_write); ++PG_FUNCTION_INFO_V1(pg_file_rename); ++PG_FUNCTION_INFO_V1(pg_file_unlink); ++PG_FUNCTION_INFO_V1(pg_logdir_ls); ++ ++typedef struct ++{ ++ char *location; ++ DIR *dirdesc; ++} directory_fctx; ++ ++/*----------------------- ++ * some helper functions ++ */ ++ ++/* ++ * Return an absolute path. Argument may be absolute or ++ * relative to the DataDir. ++ */ ++static char *absClusterPath(text *arg, bool logAllowed) ++{ ++ char *filename; ++ int len=VARSIZE(arg) - VARHDRSZ; ++ int dlen = strlen(DataDir); ++ ++ filename = palloc(len+1); ++ memcpy(filename, VARDATA(arg), len); ++ filename[len] = 0; ++ ++ if (strstr(filename, "..") != NULL) ++ ereport(ERROR, ++ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ++ (errmsg("No .. allowed in filenames")))); ++ ++ if (is_absolute_path(filename)) ++ { ++ if (logAllowed && !strncmp(filename, Log_directory, strlen(Log_directory))) ++ return filename; ++ if (strncmp(filename, DataDir, dlen)) ++ ereport(ERROR, ++ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ++ (errmsg("Absolute path not allowed")))); ++ ++ return filename; ++ } ++ else ++ { ++ char *absname = palloc(dlen+len+2); ++ sprintf(absname, "%s/%s", DataDir, filename); ++ pfree(filename); ++ return absname; ++ } ++} ++ ++ ++/* ++ * check for superuser, bark if not. ++ */ ++static void ++requireSuperuser(void) ++{ ++ if (!superuser()) ++ ereport(ERROR, ++ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ++ (errmsg("only superuser may access generic file functions")))); ++} ++ ++ ++ ++/* ------------------------------------ ++ * generic file handling functions ++ */ ++ ++Datum pg_file_write(PG_FUNCTION_ARGS) ++{ ++ FILE *f; ++ char *filename; ++ text *data; ++ int64 count = 0; ++ ++ requireSuperuser(); ++ ++ filename = absClusterPath(PG_GETARG_TEXT_P(0), false); ++ data = PG_GETARG_TEXT_P(1); ++ ++ if (PG_ARGISNULL(2) || !PG_GETARG_BOOL(2)) ++ { ++ struct stat fst; ++ if (stat(filename, &fst) >= 0) ++ ereport(ERROR, ++ (ERRCODE_DUPLICATE_FILE, ++ errmsg("file %s exists", filename))); ++ ++ f = fopen(filename, "wb"); ++ } ++ else ++ f = fopen(filename, "ab"); ++ ++ if (!f) ++ { ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("could open file %s for writing: %m", filename))); ++ } ++ ++ if (VARSIZE(data) != 0) ++ { ++ count = fwrite(VARDATA(data), 1, VARSIZE(data) - VARHDRSZ, f); ++ ++ if (count != VARSIZE(data) - VARHDRSZ) ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("error writing file %s: %m", filename))); ++ } ++ fclose(f); ++ ++ PG_RETURN_INT64(count); ++} ++ ++ ++Datum pg_file_rename(PG_FUNCTION_ARGS) ++{ ++ char *fn1, *fn2, *fn3; ++ int rc; ++ ++ requireSuperuser(); ++ ++ if (PG_ARGISNULL(0) || PG_ARGISNULL(1)) ++ PG_RETURN_NULL(); ++ ++ fn1=absClusterPath(PG_GETARG_TEXT_P(0), false); ++ fn2=absClusterPath(PG_GETARG_TEXT_P(1), false); ++ if (PG_ARGISNULL(2)) ++ fn3=0; ++ else ++ fn3=absClusterPath(PG_GETARG_TEXT_P(2), false); ++ ++ if (access(fn1, W_OK) < 0) ++ { ++ ereport(WARNING, ++ (errcode_for_file_access(), ++ errmsg("file %s not accessible: %m", fn1))); ++ ++ PG_RETURN_BOOL(false); ++ } ++ ++ if (fn3 && access(fn2, W_OK) < 0) ++ { ++ ereport(WARNING, ++ (errcode_for_file_access(), ++ errmsg("file %s not accessible: %m", fn2))); ++ ++ PG_RETURN_BOOL(false); ++ } ++ ++ ++ rc = access(fn3 ? fn3 : fn2, 2); ++ if (rc >= 0 || errno != ENOENT) ++ { ++ ereport(ERROR, ++ (ERRCODE_DUPLICATE_FILE, ++ errmsg("cannot rename to target file %s", fn3 ? fn3 : fn2))); ++ } ++ ++ if (fn3) ++ { ++ if (rename(fn2, fn3) != 0) ++ { ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("could not rename %s to %s: %m", fn2, fn3))); ++ } ++ if (rename(fn1, fn2) != 0) ++ { ++ ereport(WARNING, ++ (errcode_for_file_access(), ++ errmsg("could not rename %s to %s: %m", fn1, fn2))); ++ ++ if (rename(fn3, fn2) != 0) ++ { ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("could not rename %s back to %s: %m", fn3, fn2))); ++ } ++ else ++ { ++ ereport(ERROR, ++ (ERRCODE_UNDEFINED_FILE, ++ errmsg("renaming %s to %s was reverted", fn2, fn3))); ++ ++ } ++ } ++ } ++ else if (rename(fn1, fn2) != 0) ++ { ++ ereport(WARNING, ++ (errcode_for_file_access(), ++ errmsg("renaming %s to %s %m", fn1, fn2))); ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("could not rename %s to %s: %m", fn1, fn2))); ++ } ++ ++ PG_RETURN_BOOL(true); ++} ++ ++ ++Datum pg_file_unlink(PG_FUNCTION_ARGS) ++{ ++ char *filename; ++ ++ requireSuperuser(); ++ ++ filename = absClusterPath(PG_GETARG_TEXT_P(0), false); ++ ++ if (access(filename, W_OK) < 0) ++ { ++ if (errno == ENOENT) ++ PG_RETURN_BOOL(false); ++ else ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("file %s not accessible: %m", filename))); ++ ++ } ++ ++ if (unlink(filename) < 0) ++ { ++ ereport(WARNING, ++ (errcode_for_file_access(), ++ errmsg("could not unlink file %s: %m", filename))); ++ ++ PG_RETURN_BOOL(false); ++ } ++ PG_RETURN_BOOL(true); ++} ++ ++ ++Datum pg_logdir_ls(PG_FUNCTION_ARGS) ++{ ++ FuncCallContext *funcctx; ++ struct dirent *de; ++ directory_fctx *fctx; ++ ++ if (!superuser()) ++ ereport(ERROR, ++ (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ++ (errmsg("only superuser can list the log directory")))); ++ ++ if (memcmp(Log_filename, "postgresql-%Y-%m-%d_%H%M%S.log", 30) != 0) ++ ereport(ERROR, ++ (errcode(ERRCODE_INVALID_PARAMETER_VALUE), ++ (errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'")))); ++ ++ if (SRF_IS_FIRSTCALL()) ++ { ++ MemoryContext oldcontext; ++ TupleDesc tupdesc; ++ ++ funcctx=SRF_FIRSTCALL_INIT(); ++ oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); ++ ++ fctx = palloc(sizeof(directory_fctx)); ++ if (is_absolute_path(Log_directory)) ++ fctx->location = Log_directory; ++ else ++ { ++ fctx->location = palloc(strlen(DataDir) + strlen(Log_directory) +2); ++ sprintf(fctx->location, "%s/%s", DataDir, Log_directory); ++ } ++ tupdesc = CreateTemplateTupleDesc(2, false); ++ TupleDescInitEntry(tupdesc, (AttrNumber) 1, "starttime", ++ TIMESTAMPOID, -1, 0); ++ TupleDescInitEntry(tupdesc, (AttrNumber) 2, "filename", ++ TEXTOID, -1, 0); ++ ++ funcctx->attinmeta = TupleDescGetAttInMetadata(tupdesc); ++ ++ fctx->dirdesc = AllocateDir(fctx->location); ++ ++ if (!fctx->dirdesc) ++ ereport(ERROR, ++ (errcode_for_file_access(), ++ errmsg("%s is not browsable: %m", fctx->location))); ++ ++ funcctx->user_fctx = fctx; ++ MemoryContextSwitchTo(oldcontext); ++ } ++ ++ funcctx=SRF_PERCALL_SETUP(); ++ fctx = (directory_fctx*) funcctx->user_fctx; ++ ++ if (!fctx->dirdesc) /* not a readable directory */ ++ SRF_RETURN_DONE(funcctx); ++ ++ while ((de = readdir(fctx->dirdesc)) != NULL) ++ { ++ char *values[2]; ++ HeapTuple tuple; ++ ++ char *field[MAXDATEFIELDS]; ++ char lowstr[MAXDATELEN + 1]; ++ int dtype; ++ int nf, ftype[MAXDATEFIELDS]; ++ fsec_t fsec; ++ int tz = 0; ++ struct pg_tm date; ++ ++ /* ++ * Default format: ++ * postgresql-YYYY-MM-DD_HHMMSS.log ++ */ ++ if (strlen(de->d_name) != 32 ++ || memcmp(de->d_name, "postgresql-", 11) ++ || de->d_name[21] != '_' ++ || strcmp(de->d_name + 28, ".log")) ++ continue; ++ ++ values[1] = palloc(strlen(fctx->location) + strlen(de->d_name) + 2); ++ sprintf(values[1], "%s/%s", fctx->location, de->d_name); ++ ++ values[0] = de->d_name + 11; /* timestamp */ ++ values[0][17] = 0; ++ ++ /* parse and decode expected timestamp */ ++ if (ParseDateTime(values[0], lowstr, MAXDATELEN, field, ftype, MAXDATEFIELDS, &nf)) ++ continue; ++ ++ if (DecodeDateTime(field, ftype, nf, &dtype, &date, &fsec, &tz)) ++ continue; ++ ++ /* Seems the format fits the expected format; feed it into the tuple */ ++ ++ tuple = BuildTupleFromCStrings(funcctx->attinmeta, values); ++ ++ SRF_RETURN_NEXT(funcctx, HeapTupleGetDatum(tuple)); ++ } ++ ++ FreeDir(fctx->dirdesc); ++ SRF_RETURN_DONE(funcctx); ++} +diff -Nur postgresql-8.1.4/contrib/admin81/admin81.sql.in postgresql-8.1.4.new/contrib/admin81/admin81.sql.in +--- postgresql-8.1.4/contrib/admin81/admin81.sql.in 1970-01-01 01:00:00.000000000 +0100 ++++ postgresql-8.1.4.new/contrib/admin81/admin81.sql.in 2006-03-06 12:53:57.000000000 +0100 +@@ -0,0 +1,53 @@ ++/* *********************************************** ++ * Administrative functions - for PostgreSQL 8.1.x ++ * *********************************************** */ ++ ++/* generic file access functions (genfile.c) */ ++ ++CREATE FUNCTION pg_catalog.pg_file_write(text, text, bool) RETURNS bigint ++ AS 'MODULE_PATHNAME', 'pg_file_write' ++ LANGUAGE C VOLATILE STRICT; ++ ++CREATE FUNCTION pg_catalog.pg_file_rename(text, text, text) RETURNS bool ++ AS 'MODULE_PATHNAME', 'pg_file_rename' ++ LANGUAGE C VOLATILE; ++ ++CREATE FUNCTION pg_catalog.pg_file_unlink(text) RETURNS bool ++ AS 'MODULE_PATHNAME', 'pg_file_unlink' ++ LANGUAGE C VOLATILE STRICT; ++ ++CREATE FUNCTION pg_catalog.pg_file_rename(text, text) RETURNS bool ++ AS 'SELECT pg_file_rename($1, $2, NULL); ' ++ LANGUAGE SQL VOLATILE STRICT; ++ ++CREATE FUNCTION pg_catalog.pg_logdir_ls() RETURNS setof record ++ AS 'MODULE_PATHNAME', 'pg_logdir_ls' ++ LANGUAGE C VOLATILE STRICT; ++ ++ ++/* compatibility redefines */ ++ ++CREATE FUNCTION pg_catalog.pg_logfile_rotate() RETURNS int4 ++ AS 'pg_rotate_logfile' ++ LANGUAGE INTERNAL VOLATILE STRICT; ++ ++CREATE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint) RETURNS text ++ AS 'pg_read_file' ++ LANGUAGE INTERNAL VOLATILE STRICT; ++ ++CREATE FUNCTION pg_catalog.pg_file_length(text) RETURNS bigint ++ AS 'SELECT size FROM pg_stat_file($1)' ++ LANGUAGE SQL VOLATILE STRICT; ++ ++ ++/* ++ ++-- if running pgAdmin 1.2 against this database, ++-- this view is used to access log files ++-- (1.3 and later won't need it). ++CREATE VIEW pg_logdir_ls AS ++ SELECT * ++ FROM pg_logdir_ls() AS A ++ (filetime timestamp, filename text); ++ ++*/ +diff -Nur postgresql-8.1.4/contrib/admin81/Makefile postgresql-8.1.4.new/contrib/admin81/Makefile +--- postgresql-8.1.4/contrib/admin81/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ postgresql-8.1.4.new/contrib/admin81/Makefile 2006-03-06 12:53:57.000000000 +0100 +@@ -0,0 +1,11 @@ ++subdir = contrib/admin81 ++top_builddir = ../.. ++include $(top_builddir)/src/Makefile.global ++ ++MODULE_big = admin81 ++PG_CPPFLAGS = -I$(libpq_srcdir) ++DATA_built = admin81.sql ++DOCS = README.admin81 ++OBJS = admin81.o ++ ++include $(top_srcdir)/contrib/contrib-global.mk +diff -Nur postgresql-8.1.4/contrib/admin81/README.admin81 postgresql-8.1.4.new/contrib/admin81/README.admin81 +--- postgresql-8.1.4/contrib/admin81/README.admin81 1970-01-01 01:00:00.000000000 +0100 ++++ postgresql-8.1.4.new/contrib/admin81/README.admin81 2006-03-06 12:53:57.000000000 +0100 +@@ -0,0 +1,49 @@ ++PostgreSQL Administration Functions ++=================================== ++ ++This directory is a PostgreSQL 'contrib' module which implements a number of ++support functions which pgAdmin will use to provide additional functionality ++if installed on a server. ++ ++*** This version should be used on PostgreSQL 8.1.x Servers *** ++ ++Installation ++============ ++ ++You will need a PostgreSQL source tree which has been properly configured ++for the local system using the 'configure' script. ++ ++Copy this directory into the /contrib directory of the PostgreSQL source tree, ++and then run the following commands as a users with appropriate privileges: ++ ++make ++make install ++ ++pgAdmin will look for the functions in the Maintenance Database (usually ++"postgres" for 8.1 servers) specified in the connection dialogue for the server. ++To install the functions in the database, either run the admin81.sql script using ++the pgAdmin SQL tool (and then close and reopen the connection to the freshly ++instrumented server), or run the script using psql, eg: ++ ++psql -U postgres postgres < admin81.sql ++ ++On PostgreSQL 8.1 or above, you should use the admin81.sql script. ++ ++Objects implemented (superuser only) ++==================================== ++ ++int8 pg_catalog.pg_file_write(fname text, data text, append bool) ++int8 pg_catalog.pg_file_read(fname text, data text, append bool) ++bool pg_catalog.pg_file_rename(oldname text, newname text) ++bool pg_catalog.pg_file_rename(oldname text, newname text, archivname text) ++bool pg_catalog.pg_file_unlink(fname text) ++bigint pg_catalog.pg_file_size(text) ++int4 pg_catalog.pg_logfile_rotate() ++setof record pg_catalog.pg_logdir_ls() ++ ++ ++These functions implement full instrumentation for PostgreSQL 8.1 servers when ++accessed using pgAdmin III V1.4 and above. For pgAdmin III V1.2, the additional ++view pg_logdir_ls is necessary (available from the admin81.sql script, commented ++out in the last section). We recommend omitting this deprecated view, and ++upgrade to pgAdmin III V1.4 instead. +diff -Nur postgresql-8.1.4/contrib/Makefile postgresql-8.1.4.new/contrib/Makefile +--- postgresql-8.1.4/contrib/Makefile 2006-07-07 21:26:44.000000000 +0200 ++++ postgresql-8.1.4.new/contrib/Makefile 2006-07-07 21:27:24.000000000 +0200 +@@ -33,6 +33,7 @@ + tsearch2 \ + userlock \ + vacuumlo \ ++ admin81 \ + xml2 + + # Missing: --- postgresql-8.1-8.1.4.orig/debian/patches/10-pkglibdir.patch +++ postgresql-8.1-8.1.4/debian/patches/10-pkglibdir.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1beta4-old/src/Makefile.global.in postgresql-8.1beta4/src/Makefile.global.in +--- postgresql-8.1beta4-old/src/Makefile.global.in 2005-09-27 18:39:32.000000000 +0100 ++++ postgresql-8.1beta4/src/Makefile.global.in 2005-10-26 20:40:52.000000000 +0100 +@@ -89,7 +89,7 @@ + pkglibdir = $(libdir) + ifeq "$(findstring pgsql, $(pkglibdir))" "" + ifeq "$(findstring postgres, $(pkglibdir))" "" +-override pkglibdir := $(pkglibdir)/postgresql ++override pkglibdir := $(pkglibdir)/postgresql/8.1/lib + endif + endif + --- postgresql-8.1-8.1.4.orig/debian/patches/02-pager.patch +++ postgresql-8.1-8.1.4/debian/patches/02-pager.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1.2-old/src/bin/psql/print.h postgresql-8.1.2/src/bin/psql/print.h +--- postgresql-8.1.2-old/src/bin/psql/print.h 2005-01-01 16:43:08.100000000 +1100 ++++ postgresql-8.1.2/src/bin/psql/print.h 2005-04-19 20:40:08.166917424 +1000 +@@ -81,7 +81,7 @@ + void printQuery(const PGresult *result, const printQueryOpt *opt, FILE *fout); + + #ifndef __CYGWIN__ +-#define DEFAULT_PAGER "more" ++#define DEFAULT_PAGER "/usr/bin/pager" + #else + #define DEFAULT_PAGER "less" + #endif --- postgresql-8.1-8.1.4.orig/debian/patches/54-contrib-dbmirror-quoteparsing.patch +++ postgresql-8.1-8.1.4/debian/patches/54-contrib-dbmirror-quoteparsing.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1.4-old/contrib/dbmirror/DBMirror.pl postgresql-8.1.4/contrib/dbmirror/DBMirror.pl +--- postgresql-8.1.4-old/contrib/dbmirror/DBMirror.pl 2006-05-19 04:39:04.000000000 +0200 ++++ postgresql-8.1.4/contrib/dbmirror/DBMirror.pl 2006-06-27 22:36:07.000000000 +0200 +@@ -907,7 +907,7 @@ + $matchString = $1; + $value .= substr $matchString,0,length($matchString)-1; + +- if($matchString =~ m/(\'$)/s) { ++ if($matchString =~ m/(\'$)/s and (substr $dataField,length($matchString),1) ne "'") { + # $1 runs to the end of the field value. + $dataField = substr $dataField,length($matchString)+1; + last; --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-sql-fun-typecheck.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-sql-fun-typecheck.patch @@ -0,0 +1,207 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c.diff?r1=1.98.2.2;r2=1.98.2.3 +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.201.2.1;r2=1.201.2.2 + +Repair insufficiently careful type checking for SQL-language functions: +we should check that the function code returns the claimed result datatype +every time we parse the function for execution. Formerly, for simple +scalar result types we assumed the creation-time check was sufficient, but +this fails if the function selects from a table that's been redefined since +then, and even more obviously fails if check_function_bodies had been OFF. + +This is a significant security hole: not only can one trivially crash the +backend, but with appropriate misuse of pass-by-reference datatypes it is +possible to read out arbitrary locations in the server process's memory, +which could allow retrieving database content the user should not be able +to see. Our thanks to Jeff Trout for the initial report. + +Security: CVE-2007-0555 + +--- pgsql/src/backend/executor/functions.c 2006/10/12 17:02:28 1.98.2.2 ++++ pgsql/src/backend/executor/functions.c 2007/02/02 00:03:30 1.98.2.3 +@@ -63,7 +63,7 @@ typedef struct + { + Oid *argtypes; /* resolved types of arguments */ + Oid rettype; /* actual return type */ +- int typlen; /* length of the return type */ ++ int16 typlen; /* length of the return type */ + bool typbyval; /* true if return type is pass by value */ + bool returnsTuple; /* true if returning whole tuple result */ + bool shutdown_reg; /* true if registered shutdown callback */ +@@ -153,12 +153,9 @@ init_sql_fcache(FmgrInfo *finfo) + Oid foid = finfo->fn_oid; + Oid rettype; + HeapTuple procedureTuple; +- HeapTuple typeTuple; + Form_pg_proc procedureStruct; +- Form_pg_type typeStruct; + SQLFunctionCachePtr fcache; + Oid *argOidVect; +- bool haspolyarg; + char *src; + int nargs; + List *queryTree_list; +@@ -195,35 +192,17 @@ init_sql_fcache(FmgrInfo *finfo) + + fcache->rettype = rettype; + ++ /* Fetch the typlen and byval info for the result type */ ++ get_typlenbyval(rettype, &fcache->typlen, &fcache->typbyval); ++ + /* Remember if function is STABLE/IMMUTABLE */ + fcache->readonly_func = + (procedureStruct->provolatile != PROVOLATILE_VOLATILE); + +- /* Now look up the actual result type */ +- typeTuple = SearchSysCache(TYPEOID, +- ObjectIdGetDatum(rettype), +- 0, 0, 0); +- if (!HeapTupleIsValid(typeTuple)) +- elog(ERROR, "cache lookup failed for type %u", rettype); +- typeStruct = (Form_pg_type) GETSTRUCT(typeTuple); +- +- /* +- * get the type length and by-value flag from the type tuple; also do a +- * preliminary check for returnsTuple (this may prove inaccurate, see +- * below). +- */ +- fcache->typlen = typeStruct->typlen; +- fcache->typbyval = typeStruct->typbyval; +- fcache->returnsTuple = (typeStruct->typtype == 'c' || +- rettype == RECORDOID); +- + /* +- * Parse and rewrite the queries. We need the argument type info to pass +- * to the parser. ++ * We need the actual argument types to pass to the parser. + */ + nargs = procedureStruct->pronargs; +- haspolyarg = false; +- + if (nargs > 0) + { + int argnum; +@@ -246,7 +225,6 @@ init_sql_fcache(FmgrInfo *finfo) + errmsg("could not determine actual type of argument declared %s", + format_type_be(argOidVect[argnum])))); + argOidVect[argnum] = argtype; +- haspolyarg = true; + } + } + } +@@ -254,6 +232,9 @@ init_sql_fcache(FmgrInfo *finfo) + argOidVect = NULL; + fcache->argtypes = argOidVect; + ++ /* ++ * Parse and rewrite the queries in the function text. ++ */ + tmp = SysCacheGetAttr(PROCOID, + procedureTuple, + Anum_pg_proc_prosrc, +@@ -265,24 +246,25 @@ init_sql_fcache(FmgrInfo *finfo) + queryTree_list = pg_parse_and_rewrite(src, argOidVect, nargs); + + /* +- * If the function has any arguments declared as polymorphic types, then +- * it wasn't type-checked at definition time; must do so now. ++ * Check that the function returns the type it claims to. Although ++ * in simple cases this was already done when the function was defined, ++ * we have to recheck because database objects used in the function's ++ * queries might have changed type. We'd have to do it anyway if the ++ * function had any polymorphic arguments. + * +- * Also, force a type-check if the declared return type is a rowtype; we +- * need to find out whether we are actually returning the whole tuple +- * result, or just regurgitating a rowtype expression result. In the ++ * Note: we set fcache->returnsTuple according to whether we are ++ * returning the whole tuple result or just a single column. In the + * latter case we clear returnsTuple because we need not act different +- * from the scalar result case. ++ * from the scalar result case, even if it's a rowtype column. + * + * In the returnsTuple case, check_sql_fn_retval will also construct a + * JunkFilter we can use to coerce the returned rowtype to the desired + * form. + */ +- if (haspolyarg || fcache->returnsTuple) +- fcache->returnsTuple = check_sql_fn_retval(foid, +- rettype, +- queryTree_list, +- &fcache->junkFilter); ++ fcache->returnsTuple = check_sql_fn_retval(foid, ++ rettype, ++ queryTree_list, ++ &fcache->junkFilter); + + /* Finally, plan the queries */ + fcache->func_state = init_execution_state(queryTree_list, +@@ -290,7 +272,6 @@ init_sql_fcache(FmgrInfo *finfo) + + pfree(src); + +- ReleaseSysCache(typeTuple); + ReleaseSysCache(procedureTuple); + + finfo->fn_extra = (void *) fcache; +@@ -855,11 +836,10 @@ ShutdownSQLFunction(Datum arg) + * the final query in the function. We do some ad-hoc type checking here + * to be sure that the user is returning the type he claims. + * +- * This is normally applied during function definition, but in the case +- * of a function with polymorphic arguments, we instead apply it during +- * function execution startup. The rettype is then the actual resolved +- * output type of the function, rather than the declared type. (Therefore, +- * we should never see ANYARRAY or ANYELEMENT as rettype.) ++ * For a polymorphic function the passed rettype must be the actual resolved ++ * output type of the function; we should never see ANYARRAY or ANYELEMENT ++ * as rettype. (This means we can't check the type during function definition ++ * of a polymorphic function.) + * + * The return value is true if the function returns the entire tuple result + * of its final SELECT, and false otherwise. Note that because we allow +--- pgsql/src/backend/optimizer/util/clauses.c 2005/11/22 18:23:12 1.201.2.1 ++++ pgsql/src/backend/optimizer/util/clauses.c 2007/02/02 00:03:30 1.201.2.2 +@@ -2293,7 +2293,6 @@ inline_function(Oid funcid, Oid result_t + eval_const_expressions_context *context) + { + Form_pg_proc funcform = (Form_pg_proc) GETSTRUCT(func_tuple); +- bool polymorphic = false; + Oid *argtypes; + char *src; + Datum tmp; +@@ -2356,15 +2355,10 @@ inline_function(Oid funcid, Oid result_t + if (argtypes[i] == ANYARRAYOID || + argtypes[i] == ANYELEMENTOID) + { +- polymorphic = true; + argtypes[i] = exprType((Node *) list_nth(args, i)); + } + } + +- if (funcform->prorettype == ANYARRAYOID || +- funcform->prorettype == ANYELEMENTOID) +- polymorphic = true; +- + /* Fetch and parse the function body */ + tmp = SysCacheGetAttr(PROCOID, + func_tuple, +@@ -2417,15 +2411,13 @@ inline_function(Oid funcid, Oid result_t + newexpr = (Node *) ((TargetEntry *) linitial(querytree->targetList))->expr; + + /* +- * If the function has any arguments declared as polymorphic types, then +- * it wasn't type-checked at definition time; must do so now. (This will ++ * Make sure the function (still) returns what it's declared to. This will + * raise an error if wrong, but that's okay since the function would fail + * at runtime anyway. Note we do not try this until we have verified that + * no rewriting was needed; that's probably not important, but let's be +- * careful.) ++ * careful. + */ +- if (polymorphic) +- (void) check_sql_fn_retval(funcid, result_type, querytree_list, NULL); ++ (void) check_sql_fn_retval(funcid, result_type, querytree_list, NULL); + + /* + * Additional validity checks on the expression. It mustn't return a set, + --- postgresql-8.1-8.1.4.orig/debian/patches/52-contrib-dbase-enable-iconv.patch +++ postgresql-8.1-8.1.4/debian/patches/52-contrib-dbase-enable-iconv.patch @@ -0,0 +1,12 @@ +diff -ruN postgresql-8.1.0-old/contrib/dbase/Makefile postgresql-8.1.0/contrib/dbase/Makefile +--- postgresql-8.1.0-old/contrib/dbase/Makefile 2005-09-27 19:13:01.000000000 +0200 ++++ postgresql-8.1.0/contrib/dbase/Makefile 2005-11-20 16:28:57.000000000 +0100 +@@ -6,7 +6,7 @@ + PG_LIBS = $(libpq_pgport) + + # Uncomment this to provide charset translation +-#PG_CPPFLAGS += -DHAVE_ICONV_H ++PG_CPPFLAGS += -DHAVE_ICONV_H + # You might need to uncomment this too, if libiconv is a separate + # library on your platform + #PG_LIBS += -liconv --- postgresql-8.1-8.1.4.orig/debian/patches/12-pg_restore-ignore-failing-tables.patch +++ postgresql-8.1-8.1.4/debian/patches/12-pg_restore-ignore-failing-tables.patch @@ -0,0 +1,83 @@ +diff -ruN postgresql-8.1.3-old/doc/src/sgml/ref/pg_restore.sgml postgresql-8.1.3/doc/src/sgml/ref/pg_restore.sgml +--- postgresql-8.1.3-old/doc/src/sgml/ref/pg_restore.sgml 2005-11-01 22:09:50.000000000 +0100 ++++ postgresql-8.1.3/doc/src/sgml/ref/pg_restore.sgml 2006-03-03 19:13:50.000000000 +0100 +@@ -395,6 +395,20 @@ + + + ++ ++ ++ ++ ++ By default, table data objects are restored even if the ++ associated table could not be successfully created (e. g. ++ because it already exists). With this option, such table ++ data is silently ignored. This is useful for dumping and ++ restoring databases with tables which contain auxiliary data ++ for PostgreSQL extensions (e. g. PostGIS). ++ ++ ++ ++ + + + +diff -ruN postgresql-8.1.3-old/src/bin/pg_dump/pg_backup_archiver.c postgresql-8.1.3/src/bin/pg_dump/pg_backup_archiver.c +--- postgresql-8.1.3-old/src/bin/pg_dump/pg_backup_archiver.c 2006-02-05 21:58:57.000000000 +0100 ++++ postgresql-8.1.3/src/bin/pg_dump/pg_backup_archiver.c 2006-03-03 19:14:03.000000000 +0100 +@@ -268,6 +268,23 @@ + _printTocEntry(AH, te, ropt, false, false); + defnDumped = true; + ++ /* If we could not create a table, ignore the respective TABLE DATA if ++ * -X no-data-for-failed-tables is given */ ++ if (ropt->noDataForFailedTables && AH->lastErrorTE == te && strcmp (te->desc, "TABLE") == 0) { ++ TocEntry *tes, *last; ++ ++ ahlog (AH, 1, "table %s could not be created, will not restore its data\n", te->tag); ++ ++ for (last = te, tes = te->next; tes != AH->toc; last = tes, tes = tes->next) { ++ if (strcmp (tes->desc, "TABLE DATA") == 0 && strcmp (tes->tag, te->tag) == 0 && ++ strcmp (tes->namespace ? tes->namespace : "", te->namespace ? te->namespace : "") == 0) { ++ /* remove this node */ ++ last->next = tes->next; ++ break; ++ } ++ } ++ } ++ + /* If we created a DB, connect to it... */ + if (strcmp(te->desc, "DATABASE") == 0) + { +diff -ruN postgresql-8.1.3-old/src/bin/pg_dump/pg_backup.h postgresql-8.1.3/src/bin/pg_dump/pg_backup.h +--- postgresql-8.1.3-old/src/bin/pg_dump/pg_backup.h 2005-10-15 04:49:38.000000000 +0200 ++++ postgresql-8.1.3/src/bin/pg_dump/pg_backup.h 2006-03-03 19:13:50.000000000 +0100 +@@ -106,6 +106,7 @@ + char *pghost; + char *username; + int ignoreVersion; ++ int noDataForFailedTables; + int requirePassword; + int exit_on_error; + +diff -ruN postgresql-8.1.3-old/src/bin/pg_dump/pg_restore.c postgresql-8.1.3/src/bin/pg_dump/pg_restore.c +--- postgresql-8.1.3-old/src/bin/pg_dump/pg_restore.c 2006-03-03 19:13:48.000000000 +0100 ++++ postgresql-8.1.3/src/bin/pg_dump/pg_restore.c 2006-03-03 19:13:50.000000000 +0100 +@@ -254,6 +254,8 @@ + use_setsessauth = 1; + else if (strcmp(optarg, "disable-triggers") == 0) + disable_triggers = 1; ++ else if (strcmp(optarg, "no-data-for-failed-tables") == 0) ++ opts->noDataForFailedTables = 1; + else + { + fprintf(stderr, +@@ -394,6 +396,8 @@ + printf(_(" -X use-set-session-authorization, --use-set-session-authorization\n" + " use SESSION AUTHORIZATION commands instead of\n" + " OWNER TO commands\n")); ++ printf(_(" -X no-data-for-failed-tables\n" ++ " do not restore data of tables which could not be created\n")); + + printf(_("\nConnection options:\n")); + printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); --- postgresql-8.1-8.1.4.orig/debian/patches/00upstream-max-utf8-wchar-len.patch +++ postgresql-8.1-8.1.4/debian/patches/00upstream-max-utf8-wchar-len.patch @@ -0,0 +1,136 @@ +http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/wchar.c.diff?r1=1.47.2.4;r2=1.47.2.5 + +Get pg_utf_mblen(), pg_utf2wchar_with_len(), and utf2ucs() all on the same +page about the maximum UTF8 sequence length we support (4 bytes since 8.1, +3 before that). pg_utf2wchar_with_len never got updated to support 4-byte +characters at all, and in any case had a buffer-overrun risk in that it +could produce multiple pg_wchars from what mblen claims to be just one UTF8 +character. The only reason we don't have a major security hole is that most +callers allocate worst-case output buffers; the sole exception in released +versions appears to be pre-8.2 iwchareq() (ie, ILIKE), which can be crashed +due to zeroing out its return address --- but AFAICS that can't be exploited +for anything more than a crash, due to inability to control what gets written +there. Per report from James Russell and Michael Fuhr. + +Pre-8.1 the risk is much less, but I still think pg_utf2wchar_with_len's +behavior given an incomplete final character risks buffer overrun, so +back-patch that logic change anyway. + +This patch also makes sure that UTF8 sequences exceeding the supported +length (whichever it is) are consistently treated as error cases, rather +than being treated like a valid shorter sequence in some places. + +--- pgsql/src/backend/utils/mb/wchar.c 2006/08/22 12:11:38 1.47.2.4 ++++ pgsql/src/backend/utils/mb/wchar.c 2007/01/24 17:12:29 1.47.2.5 +@@ -345,18 +345,19 @@ pg_johab_dsplen(const unsigned char *s) + } + + /* +- * convert UTF8 string to pg_wchar (UCS-2) +- * caller should allocate enough space for "to" ++ * convert UTF8 string to pg_wchar (UCS-4) ++ * caller must allocate enough space for "to", including a trailing zero! + * len: length of from. + * "from" not necessarily null terminated. + */ + static int + pg_utf2wchar_with_len(const unsigned char *from, pg_wchar *to, int len) + { +- unsigned char c1, +- c2, +- c3; + int cnt = 0; ++ uint32 c1, ++ c2, ++ c3, ++ c4; + + while (len > 0 && *from) + { +@@ -365,26 +366,39 @@ pg_utf2wchar_with_len(const unsigned cha + *to = *from++; + len--; + } +- else if ((*from & 0xe0) == 0xc0 && len >= 2) ++ else if ((*from & 0xe0) == 0xc0) + { ++ if (len < 2) ++ break; /* drop trailing incomplete char */ + c1 = *from++ & 0x1f; + c2 = *from++ & 0x3f; +- *to = c1 << 6; +- *to |= c2; ++ *to = (c1 << 6) | c2; + len -= 2; + } +- else if ((*from & 0xe0) == 0xe0 && len >= 3) ++ else if ((*from & 0xf0) == 0xe0) + { ++ if (len < 3) ++ break; /* drop trailing incomplete char */ + c1 = *from++ & 0x0f; + c2 = *from++ & 0x3f; + c3 = *from++ & 0x3f; +- *to = c1 << 12; +- *to |= c2 << 6; +- *to |= c3; ++ *to = (c1 << 12) | (c2 << 6) | c3; + len -= 3; + } ++ else if ((*from & 0xf8) == 0xf0) ++ { ++ if (len < 4) ++ break; /* drop trailing incomplete char */ ++ c1 = *from++ & 0x07; ++ c2 = *from++ & 0x3f; ++ c3 = *from++ & 0x3f; ++ c4 = *from++ & 0x3f; ++ *to = (c1 << 18) | (c2 << 12) | (c3 << 6) | c4; ++ len -= 4; ++ } + else + { ++ /* treat a bogus char as length 1; not ours to raise error */ + *to = *from++; + len--; + } +@@ -396,12 +410,20 @@ pg_utf2wchar_with_len(const unsigned cha + } + + /* +- * returns the byte length of a UTF8 character pointed to by s ++ * Return the byte length of a UTF8 character pointed to by s ++ * ++ * Note: in the current implementation we do not support UTF8 sequences ++ * of more than 4 bytes; hence do NOT return a value larger than 4. ++ * We return "1" for any leading byte that is either flat-out illegal or ++ * indicates a length larger than we support. ++ * ++ * pg_utf2wchar_with_len(), utf2ucs(), pg_utf8_islegal(), and perhaps ++ * other places would need to be fixed to change this. + */ + int + pg_utf_mblen(const unsigned char *s) + { +- int len = 1; ++ int len; + + if ((*s & 0x80) == 0) + len = 1; +@@ -411,11 +433,15 @@ pg_utf_mblen(const unsigned char *s) + len = 3; + else if ((*s & 0xf8) == 0xf0) + len = 4; ++#ifdef NOT_USED + else if ((*s & 0xfc) == 0xf8) + len = 5; + else if ((*s & 0xfe) == 0xfc) + len = 6; +- return (len); ++#endif ++ else ++ len = 1; ++ return len; + } + + static int --- postgresql-8.1-8.1.4.orig/debian/patches/01-build-contrib.patch +++ postgresql-8.1-8.1.4/debian/patches/01-build-contrib.patch @@ -0,0 +1,37 @@ +diff -ruN postgresql-8.1.0rc2-old/GNUmakefile.in postgresql-8.1.0rc2/GNUmakefile.in +--- postgresql-8.1.0rc2-old/GNUmakefile.in 2004-10-06 10:49:58.100000000 +0200 ++++ postgresql-8.1.0rc2/GNUmakefile.in 2004-11-20 23:16:40.505472992 +0200 +@@ -4,6 +4,8 @@ + # $PostgreSQL: pgsql/GNUmakefile.in,v 1.41 2004/10/06 08:49:58 momjian Exp $ + # + ++# For Debian, we also build contrib ++ + subdir = + top_builddir = . + include $(top_builddir)/src/Makefile.global +@@ -12,21 +14,22 @@ + $(MAKE) -C doc all + $(MAKE) -C src all + $(MAKE) -C config all ++ $(MAKE) -C contrib all + @echo "All of PostgreSQL successfully made. Ready to install." + + install: + $(MAKE) -C doc $@ + $(MAKE) -C src $@ + $(MAKE) -C config $@ ++ $(MAKE) -C contrib $@ + @echo "PostgreSQL installation complete." + + installdirs uninstall distprep: + $(MAKE) -C doc $@ + $(MAKE) -C src $@ + $(MAKE) -C config $@ ++ $(MAKE) -C contrib $@ + +-# clean, distclean, etc should apply to contrib too, even though +-# it's not built by default + clean: + $(MAKE) -C doc $@ + $(MAKE) -C contrib $@ --- postgresql-8.1-8.1.4.orig/debian/copyright +++ postgresql-8.1-8.1.4/debian/copyright @@ -0,0 +1,110 @@ +This package was debianized by Martin Pitt . + +PostgreSQL was downloaded from ftp://ftp.postgresql.org/mirror/postgresql/src/ + +Please note that there are many other mirrors, listed on +http://www.postgresql.org/mirrors-ftp.html. + +Copyright. The following copyright applies to the entire distribution: + + PostgreSQL Data Base Management System + (formerly known as Postgres, then as Postgres95). + + Portions Copyright (c) 1996-2003, The PostgreSQL Global Development Group + + Portions Copyright (c) 1994, The Regents of the University of California + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose, without fee, and without a written agreement + is hereby granted, provided that the above copyright notice and this + paragraph and the following two paragraphs appear in all copies. + + IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS + DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO + PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + + +The following copyright applies to the regex code in the backend +(src/backend/regex): + + Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. + + Development of this software was funded, in part, by Cray Research Inc., + UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics + Corporation, none of whom are responsible for the results. The author + thanks all of them. + + Redistribution and use in source and binary forms -- with or without + modification -- are permitted for any purpose, provided that + redistributions in source form retain this entire copyright notice and + indicate the origin and nature of any modifications. + + I'd appreciate being given credit for this package in the documentation + of software which uses it, but that is not a requirement. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PostgreSQL adopted the code out of Tcl 8.4.1. Portions of regc_locale.c +and re_syntax.n were developed by Tcl developers other than Henry; these +files bear the Tcl copyright and license notice: + + This software is copyrighted by the Regents of the University of + California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState + Corporation and other parties. The following terms apply to all files + associated with the software unless explicitly disclaimed in + individual files. + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. + + GOVERNMENT USE: If you are acquiring this software on behalf of the + U.S. government, the Government shall have only "Restricted Rights" + in the software and related documentation as defined in the Federal + Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you + are acquiring the software on behalf of the Department of Defense, the + software shall be classified as "Commercial Computer Software" and the + Government shall have only "Restricted Rights" as defined in Clause + 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the + authors grant the U.S. Government and others acting in its behalf + permission to use and distribute the software in accordance with the + terms specified in this license. + +Subsequent modifications to the code by the PostgreSQL project follow +the same license terms as the rest of PostgreSQL. --- postgresql-8.1-8.1.4.orig/debian/postgresql-doc-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-doc-8.1.install @@ -0,0 +1 @@ +usr/share/doc/postgresql-doc-8.1/html/* --- postgresql-8.1-8.1.4.orig/debian/postgresql-plperl-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-plperl-8.1.install @@ -0,0 +1 @@ +usr/lib/postgresql/8.1/lib/plperl.so --- postgresql-8.1-8.1.4.orig/debian/postgresql-client-8.1.postinst +++ postgresql-8.1-8.1.4/debian/postgresql-client-8.1.postinst @@ -0,0 +1,11 @@ +#!/bin/sh -e + +VERSION=8.1 + +. /usr/share/postgresql-common/maintscripts-functions + +if [ "$1" = configure ]; then + configure_client_version $VERSION "$2" +fi + +#DEBHELPER# --- postgresql-8.1-8.1.4.orig/debian/postgresql-8.1.init +++ postgresql-8.1-8.1.4/debian/postgresql-8.1.init @@ -0,0 +1,55 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: postgresql postgresql-8.1 +# Required-Start: $local_fs $network $time +# Required-Stop: $local_fs $network $time +# Should-Start: $syslog $remote_fs +# Should-Stop: $syslog $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: PostgreSQL 8.1 RDBMS server +### END INIT INFO + +# Setting environment variables for the postmaster here does not work; please +# set them in /etc/postgresql/8.1//environment instead. + +[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0 + +. /usr/share/postgresql-common/init.d-functions + +VERSION=8.1 + +case "$1" in + start) + start $VERSION + ;; + stop) + stop "$VERSION" + ;; + restart) + restart "$VERSION" + ;; + force-reload | reload) + reload $VERSION + ;; + status) + status $VERSION + ;; + autovac-start) + autovac_start $VERSION + ;; + autovac-stop) + autovac_stop $VERSION + ;; + autovac-restart) + autovac_restart $VERSION + ;; + *) + echo "Usage: $0 {start|stop|restart|reload|force-reload|status|autovac-start|autovac-stop|autovac-restart}" + exit 1 + ;; +esac + +exit 0 + --- postgresql-8.1-8.1.4.orig/debian/libpq4.install +++ postgresql-8.1-8.1.4/debian/libpq4.install @@ -0,0 +1,2 @@ +usr/lib/libpq.so.4* +usr/share/locale/*/LC_MESSAGES/libpq4.mo --- postgresql-8.1-8.1.4.orig/debian/postgresql-plpython-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-plpython-8.1.install @@ -0,0 +1 @@ +usr/lib/postgresql/8.1/lib/plpython.so --- postgresql-8.1-8.1.4.orig/debian/postgresql-doc-8.1.dirs +++ postgresql-8.1-8.1.4/debian/postgresql-doc-8.1.dirs @@ -0,0 +1 @@ +/usr/share/doc/postgresql-doc-8.1/tutorial --- postgresql-8.1-8.1.4.orig/debian/postgresql-pltcl-8.1.install +++ postgresql-8.1-8.1.4/debian/postgresql-pltcl-8.1.install @@ -0,0 +1,3 @@ +usr/lib/postgresql/8.1/lib/pltcl.so +usr/lib/postgresql/8.1/bin/pltcl_* +usr/share/postgresql/8.1/unknown.pltcl