1 diff -ruN postgresql-7.4.6-orig/contrib/Makefile postgresql-7.4.6-3/contrib/Makefile
2 --- postgresql-7.4.6-orig/contrib/Makefile 2003-09-11 19:15:27.000000000 +0200
3 +++ postgresql-7.4.6-3/contrib/Makefile 2005-03-09 15:56:11.000000000 +0100
24 # array \ (removed all but the README)
26 # ipc_check \ (does not have a makefile)
27 # mSQL-interface \ (requires msql installed)
28 # mac \ (does not have a makefile)
29 -# mysql \ (does not have a makefile)
30 -# oracle \ (does not have a makefile)
31 # pg_upgrade \ (does not have a makefile)
32 # reindexdb \ (does not have a makefile)
33 # start-scripts \ (does not have a makefile)
34 # tools \ (does not have a makefile)
35 -# xml \ (non-standard makefile)
38 all install installdirs uninstall clean distclean maintainer-clean check installcheck:
39 diff -ruN postgresql-7.4.6-orig/contrib/dbase/dbf2pg.c postgresql-7.4.6-3/contrib/dbase/dbf2pg.c
40 --- postgresql-7.4.6-orig/contrib/dbase/dbf2pg.c 2003-09-28 00:24:49.000000000 +0200
41 +++ postgresql-7.4.6-3/contrib/dbase/dbf2pg.c 2005-03-09 15:56:11.000000000 +0100
44 strcat(query, " char");
48 + strcat(query, " text");
54 printf("%s\n", query);
57 - if ((res = PQexec(conn, query)) == NULL)
58 + if ((res = PQexec(conn, query)) == NULL ||
59 + PQresultStatus(res) == PGRES_BAD_RESPONSE ||
60 + PQresultStatus(res) == PGRES_NONFATAL_ERROR ||
61 + PQresultStatus(res) == PGRES_FATAL_ERROR)
63 fprintf(stderr, "Error creating table!\n");
64 fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
67 sprintf(query, "COPY %s FROM stdin", table);
68 res = PQexec(conn, query);
71 + PQresultStatus(res)==PGRES_BAD_RESPONSE ||
72 + PQresultStatus(res)==PGRES_NONFATAL_ERROR ||
73 + PQresultStatus(res)==PGRES_FATAL_ERROR)
75 fprintf(stderr, "Error starting COPY!\n");
76 fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
77 diff -ruN postgresql-7.4.6-orig/contrib/dbmirror/Makefile postgresql-7.4.6-3/contrib/dbmirror/Makefile
78 --- postgresql-7.4.6-orig/contrib/dbmirror/Makefile 2002-06-23 23:58:07.000000000 +0200
79 +++ postgresql-7.4.6-3/contrib/dbmirror/Makefile 2005-03-09 15:56:11.000000000 +0100
81 include $(top_builddir)/src/Makefile.global
84 +SCRIPTS = clean_pending.pl DBMirror.pl
85 +DATA = AddTrigger.sql MirrorSetup.sql slaveDatabase.conf
86 DOCS = README.dbmirror
88 include $(top_srcdir)/contrib/contrib-global.mk
89 diff -ruN postgresql-7.4.6-orig/contrib/mysql/Makefile postgresql-7.4.6-3/contrib/mysql/Makefile
90 --- postgresql-7.4.6-orig/contrib/mysql/Makefile 1970-01-01 01:00:00.000000000 +0100
91 +++ postgresql-7.4.6-3/contrib/mysql/Makefile 2005-03-09 15:56:11.000000000 +0100
93 +# mysql conversion Perl scripts
95 +subdir = contrib/mysql
97 +include $(top_builddir)/src/Makefile.global
100 +SCRIPTS = my2pg.pl mysql2pgsql
103 +include $(top_srcdir)/contrib/contrib-global.mk
105 diff -ruN postgresql-7.4.6-orig/contrib/mysql/mysql2pgsql postgresql-7.4.6-3/contrib/mysql/mysql2pgsql
106 --- postgresql-7.4.6-orig/contrib/mysql/mysql2pgsql 2001-01-18 08:16:56.000000000 +0100
107 +++ postgresql-7.4.6-3/contrib/mysql/mysql2pgsql 2005-03-09 15:56:11.000000000 +0100
112 # Take a MySQL schema dump and turn it into SQL92 and PostgreSQL form.
113 # Thomas Lockhart, (c) 2000, PostgreSQL Inc.
114 diff -ruN postgresql-7.4.6-orig/contrib/oracle/Makefile postgresql-7.4.6-3/contrib/oracle/Makefile
115 --- postgresql-7.4.6-orig/contrib/oracle/Makefile 1970-01-01 01:00:00.000000000 +0100
116 +++ postgresql-7.4.6-3/contrib/oracle/Makefile 2005-03-09 15:56:11.000000000 +0100
118 +# oracle conversion Perl scripts
120 +subdir = contrib/oracle
121 +top_builddir = ../..
122 +include $(top_builddir)/src/Makefile.global
125 +SCRIPTS = Ora2Pg.pm ora2pg.pl
126 +DOCS = README.ora2pg
128 +include $(top_srcdir)/contrib/contrib-global.mk
129 diff -ruN postgresql-7.4.6-orig/contrib/oracle/ora2pg.pl postgresql-7.4.6-3/contrib/oracle/ora2pg.pl
130 --- postgresql-7.4.6-orig/contrib/oracle/ora2pg.pl 2003-01-07 23:17:14.000000000 +0100
131 +++ postgresql-7.4.6-3/contrib/oracle/ora2pg.pl 2005-03-09 15:56:11.000000000 +0100
136 +# allow to put Ora2Pg.pm in the same directory as this script
138 +use lib dirname($0);
142 # Initialyze the database connection
143 diff -ruN postgresql-7.4.6-orig/contrib/pg_autovacuum/pg_autovacuum.c postgresql-7.4.6-3/contrib/pg_autovacuum/pg_autovacuum.c
144 --- postgresql-7.4.6-orig/contrib/pg_autovacuum/pg_autovacuum.c 2004-05-26 20:48:36.000000000 +0200
145 +++ postgresql-7.4.6-3/contrib/pg_autovacuum/pg_autovacuum.c 2005-03-09 15:56:11.000000000 +0100
149 #include "pg_autovacuum.h"
158 char timebuffer[TIMEBUFF];
164 + char* pgdata = getenv("PGDATA");
166 + /* Check if PGDATA is set. Needed to create pid file. */
169 + fprintf(stderr, "Error: PGDATA not defined. Could not create pid file. Aborting\n");
174 if (pid == (pid_t) -1)
179 +#define PIDFILEBUF 1024
180 + char databuf[PIDFILEBUF];
181 + char *dataptr = databuf;
182 + char *pidfilename = "/autovacuum.pid";
185 + /* If we can determine PGDATA, write a PID file there.
186 + * This is a fudge that depends on Debian's setting PGDATA
187 + * before calling pg_autovacuum in the init script. It
188 + * could do with being cleaned up for submission upstream. */
189 + strncpy(dataptr, pgdata, PIDFILEBUF - 1);
190 + databuf[PIDFILEBUF - 1] = '\0';
191 + if (strlen(dataptr) > 0 && strlen(dataptr) < PIDFILEBUF - strlen(pidfilename - 1)) {
192 + strcat(dataptr, pidfilename);
193 + /* Don't bother to report errors in opening PIDFILE */
194 + if ((PIDFILE = fopen((const char *) dataptr, "w")) != NULL) {
195 + fprintf(PIDFILE, "%d\n", pid);
199 /* Parent should just exit, without doing any atexit cleanup */
203 + /* detach from stdin, stdout and stderr
204 + * (patched by Martin Pitt <mpitt@debian.org> for the Debian package) */
205 + nullfd = open("/dev/null", O_RDWR);
209 + if (nullfd != 0 && nullfd != 1 && nullfd != 2)
212 /* GH: If there's no setsid(), we hopefully don't need silent mode.
213 * Until there's a better solution. */
215 diff -ruN postgresql-7.4.6-orig/contrib/xml/Makefile postgresql-7.4.6-3/contrib/xml/Makefile
216 --- postgresql-7.4.6-orig/contrib/xml/Makefile 2002-10-22 22:03:09.000000000 +0200
217 +++ postgresql-7.4.6-3/contrib/xml/Makefile 2005-03-09 15:56:11.000000000 +0100
220 include $(top_builddir)/src/Makefile.global
222 +CFLAGS += $(shell xml2-config --cflags)
223 MODULE_big = pgxml_dom
226 diff -ruN postgresql-7.4.6-orig/doc/src/sgml/Makefile postgresql-7.4.6-3/doc/src/sgml/Makefile
227 --- postgresql-7.4.6-orig/doc/src/sgml/Makefile 2004-03-09 21:10:19.000000000 +0100
228 +++ postgresql-7.4.6-3/doc/src/sgml/Makefile 2005-03-09 15:56:11.000000000 +0100
230 $(NSGMLS) $(NSGMLS_FLAGS) $< | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION) --date "`date '+%Y-%m-%d'`"
231 $(mkinstalldirs) man1 man$(DEFAULTSECTION)
233 + mmv '*.' "#l1.$(DEFAULTSECTION)"
234 + mmv '* *.'$(DEFAULTSECTION) "#1_#2.$(DEFAULTSECTION)"
235 + mmv '* *.'$(DEFAULTSECTION) "#1_#2.$(DEFAULTSECTION)"
236 mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
239 diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/initdb.sgml postgresql-7.4.6-3/doc/src/sgml/ref/initdb.sgml
240 --- postgresql-7.4.6-orig/doc/src/sgml/ref/initdb.sgml 2003-08-31 19:32:23.000000000 +0200
241 +++ postgresql-7.4.6-3/doc/src/sgml/ref/initdb.sgml 2005-03-09 15:56:11.000000000 +0100
248 + <term><option>--debian-conffile</option></term>
251 + On Debian systems, this option is used by the package's
252 + post-initialisation script when it runs <command>initdb</command> to
254 + It symlinks the configuration files into the <filename>/etc/postgresql</filename>
255 + directory, whereas the standard behaviour is to put these files
256 + into the database directory.
259 + This option disables that behaviour, thus causing <command>initdb</command>
260 + to behave as expected.
267 diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dump.sgml postgresql-7.4.6-3/doc/src/sgml/ref/pg_dump.sgml
268 --- postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dump.sgml 2004-10-22 00:49:04.000000000 +0200
269 +++ postgresql-7.4.6-3/doc/src/sgml/ref/pg_dump.sgml 2005-03-09 15:56:11.000000000 +0100
274 + <term><option>-N</></term>
275 + <term><option>--convert-now</></term>
278 + In DEFAULT clauses of table column definitions, convert the old
279 + <literal>DEFAULT 'now'</literal> syntax (up to PostgreSQL 7.3) to
280 + <literal>DEFAULT now()</literal>.
286 <term><option>-o</></term>
287 <term><option>--oids</></term>
289 diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dumpall.sgml postgresql-7.4.6-3/doc/src/sgml/ref/pg_dumpall.sgml
290 --- postgresql-7.4.6-orig/doc/src/sgml/ref/pg_dumpall.sgml 2003-11-04 10:45:30.000000000 +0100
291 +++ postgresql-7.4.6-3/doc/src/sgml/ref/pg_dumpall.sgml 2005-03-09 15:56:11.000000000 +0100
296 + <term><option>-N</></term>
297 + <term><option>--convert-now</></term>
300 + In DEFAULT clauses of table column definitions, convert the old
301 + <literal>DEFAULT 'now'</literal> syntax (up to PostgreSQL 7.3) to
302 + <literal>DEFAULT now()</literal>.
308 <term><option>-o</></term>
309 <term><option>--oids</></term>
311 diff -ruN postgresql-7.4.6-orig/doc/src/sgml/ref/psql-ref.sgml postgresql-7.4.6-3/doc/src/sgml/ref/psql-ref.sgml
312 --- postgresql-7.4.6-orig/doc/src/sgml/ref/psql-ref.sgml 2003-11-01 02:56:29.000000000 +0100
313 +++ postgresql-7.4.6-3/doc/src/sgml/ref/psql-ref.sgml 2005-03-09 15:56:11.000000000 +0100
315 local host. The default port number is compile-time determined.
316 Since the database server uses the same default, you will not have
317 to specify the port in most cases. The default user name is your
318 - Unix user name, as is the default database name. Note that you can't
319 + Unix user name. In standard PostgreSQL, the database name defaults to your
320 + username too, but in this Debian version, when called through pg_wrapper,
321 + the database must be specified. Note that you can't
322 just connect to any database under any user name. Your database
323 administrator should have informed you about your access rights. To
324 save you some typing you can also set the environment variables
325 diff -ruN postgresql-7.4.6-orig/ipkg/libpq/CONTROL/control postgresql-7.4.6-3/ipkg/libpq/CONTROL/control
326 diff -ruN postgresql-7.4.6-orig/ipkg/libpq-dev/CONTROL/control postgresql-7.4.6-3/ipkg/libpq-dev/CONTROL/control
327 diff -ruN postgresql-7.4.6-orig/ipkg/pgsql-utils/CONTROL/control postgresql-7.4.6-3/ipkg/pgsql-utils/CONTROL/control
328 diff -ruN postgresql-7.4.6-orig/ipkg/rules postgresql-7.4.6-3/ipkg/rules
329 diff -ruN postgresql-7.4.6-orig/ipkg/version postgresql-7.4.6-3/ipkg/version
330 diff -ruN postgresql-7.4.6-orig/src/Makefile.global.in postgresql-7.4.6-3/src/Makefile.global.in
331 --- postgresql-7.4.6-orig/src/Makefile.global.in 2003-12-20 00:29:29.000000000 +0100
332 +++ postgresql-7.4.6-3/src/Makefile.global.in 2005-03-09 15:56:11.000000000 +0100
334 pkglibdir = $(libdir)
335 ifeq "$(findstring pgsql, $(pkglibdir))" ""
336 ifeq "$(findstring postgres, $(pkglibdir))" ""
337 -override pkglibdir := $(pkglibdir)/postgresql
338 +override pkglibdir := $(pkglibdir)/postgresql/lib
342 diff -ruN postgresql-7.4.6-orig/src/backend/libpq/pg_hba.conf.sample postgresql-7.4.6-3/src/backend/libpq/pg_hba.conf.sample
343 --- postgresql-7.4.6-orig/src/backend/libpq/pg_hba.conf.sample 2003-09-13 18:43:38.000000000 +0200
344 +++ postgresql-7.4.6-3/src/backend/libpq/pg_hba.conf.sample 2005-03-09 15:56:11.000000000 +0100
346 # DATABASE can be "all", "sameuser", "samegroup", a database name (or
347 # a comma-separated list thereof), or a file name prefixed with "@".
348 # USER can be "all", an actual user name or a group name prefixed with
349 -# "+" or a list containing either. IP-ADDRESS and IP-MASK specify the
350 -# set of hosts the record matches. CIDR-MASK is an integer between 0
351 -# and 32 (IPv6) or 128(IPv6) inclusive, that specifies the number of
352 -# significant bits in the mask, so an IPv4 CIDR-MASK of 8 is equivalent
353 -# to an IP-MASK of 255.0.0.0, and an IPv6 CIDR-MASK of 64 is equivalent
354 -# to an IP-MASK of ffff:ffff:ffff:ffff::. METHOD can be "trust", "reject",
355 -# "md5", "crypt", "password", "krb4", "krb5", "ident", or "pam". Note
356 -# that "password" uses clear-text passwords; "md5" is preferred for
357 +# "+", an include file prefixed with "@" or a list containing either.
358 +# IP-ADDRESS and IP-MASK specify the set of hosts the record matches.
359 +# CIDR-MASK is an integer between 0 and 32 (IPv6) or 128(IPv6)
360 +# inclusive, that specifies the number of significant bits in the
361 +# mask, so an IPv4 CIDR-MASK of 8 is equivalent to an IP-MASK of
362 +# 255.0.0.0, and an IPv6 CIDR-MASK of 64 is equivalent to an IP-MASK
363 +# of ffff:ffff:ffff:ffff::. METHOD can be "trust", "reject", "md5",
364 +# "crypt", "password", "krb5", "ident", or "pam". Note that
365 +# "password" uses clear-text passwords; "md5" is preferred for
366 # encrypted passwords. OPTION is the ident map or the name of the PAM
370 +# If you use include files for users and/or databases (see PostgreSQL
371 +# documentation, section 19.1), these files must be placed in the
372 +# database directory. Usually this is /var/lib/postgres/data/, but
373 +# that can be changed in /etc/postgresql/postmaster.conf with the
374 +# POSTGRES_DATA variable. Putting them in /etc/postgresql/ will NOT
375 +# work since the configuration files are only symlinked from
378 # This file is read on server startup and when the postmaster receives
379 # a SIGHUP signal. If you edit the file on a running system, you have
380 # to SIGHUP the postmaster for the changes to take effect, or use
384 +# Upstream default configuration
386 +# The following configuration is the upstream default, which allows
387 +# unrestricted access to amy database by any user on the local machine.
389 +# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
391 +#local all all trust
392 +# IPv4-style local connections:
393 +#host all all 127.0.0.1 255.255.255.255 trust
394 +# IPv6-style local connections:
396 # Put your actual configuration here
397 # ----------------------------------
399 -# CAUTION: The default configuration allows any local user to connect
400 -# using any PostgreSQL user name, including the superuser, over either
401 -# Unix-domain sockets or TCP/IP. If you are on a multiple-user
402 -# machine, the default configuration is probably too liberal for you.
403 -# Change it to use something other than "trust" authentication.
404 +# This default configuration allows any local user to connect as himself
405 +# without a password, either through a Unix socket or through TCP/IP; users
406 +# on other machines are denied access.
408 # If you want to allow non-local connections, you need to add more
409 -# "host" records. Also, remember TCP/IP connections are only enabled
410 -# if you enable "tcpip_socket" in postgresql.conf.
412 +# "host" records before the final line that rejects all TCP/IP connections.
413 +# Also, remember TCP/IP connections are only enabled if you enable
414 +# "tcpip_socket" in /etc/postgresql/postgresql.conf.
417 +# If you change this first entry you will need to make sure the postgres user
418 +# can access the database using some other method. The postgres user needs
419 +# non-interactive access to all databases during automatic maintenance
420 +# (see the vacuum command and the /usr/lib/postgresql/bin/do.maintenance
423 # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
424 +# Database administrative login by UNIX sockets
425 +local all postgres ident sameuser
427 +# All other connections by UNIX sockets
428 +local all all ident sameuser
430 +# All IPv4 connections from localhost
431 +host all all 127.0.0.1 255.255.255.255 ident sameuser
433 +# All IPv6 localhost connections
434 +host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff ident sameuser
435 +host all all ::ffff:127.0.0.1/128 ident sameuser
437 +# reject all other connection attempts
438 +host all all 0.0.0.0 0.0.0.0 reject
441 -# IPv4-style local connections:
442 -host all all 127.0.0.1 255.255.255.255 trust
443 -# IPv6-style local connections:
444 -host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
445 diff -ruN postgresql-7.4.6-orig/src/backend/storage/file/fd.c postgresql-7.4.6-3/src/backend/storage/file/fd.c
446 --- postgresql-7.4.6-orig/src/backend/storage/file/fd.c 2004-02-24 00:03:43.000000000 +0100
447 +++ postgresql-7.4.6-3/src/backend/storage/file/fd.c 2005-03-09 15:56:11.000000000 +0100
449 #include "storage/fd.h"
450 #include "storage/ipc.h"
452 +#ifdef CHECK_RLIMIT_NOFILE
453 +#include <sys/resource.h>
456 /* Filename components for OpenTemporaryFile */
457 #define PG_TEMP_FILES_DIR "pgsql_tmp"
458 @@ -272,15 +275,28 @@
462 +#ifdef CHECK_RLIMIT_NOFILE
463 + struct rlimit rlim;
467 fd = (int *) palloc(size * sizeof(int));
469 +#ifdef CHECK_RLIMIT_NOFILE
470 + getrlimit(RLIMIT_NOFILE, &rlim);
473 /* dup until failure ... */
478 +#ifdef CHECK_RLIMIT_NOFILE
479 + /* Don't go beyond RLIMIT_NOFILE */
480 + if (highestfd >= rlim.rlim_cur - 1)
487 diff -ruN postgresql-7.4.6-orig/src/bin/initdb/initdb.sh postgresql-7.4.6-3/src/bin/initdb/initdb.sh
488 --- postgresql-7.4.6-orig/src/bin/initdb/initdb.sh 2004-05-05 18:09:56.000000000 +0200
489 +++ postgresql-7.4.6-3/src/bin/initdb/initdb.sh 2005-03-09 15:56:11.000000000 +0100
495 CMDNAME=`basename $0`
497 # Placed here during build
504 # Note: There is a single compelling reason that the name of the database
505 # superuser be the same as the Unix user owning the server process:
508 PGLC_TIME=`echo $1 | sed 's/^[^=]*=//'`
510 +# Debian's initdb is going to try to symlink the files from $PGDATA to
511 +# /etc/postgres... but if you're initialising a database somewhere else,
512 +# you don't want this behaviour, so tell initdb to not do it.
514 + debian_conffile=yes
515 + echo "use debian conffile location"
520 echo "$CMDNAME: invalid option: $1"
523 # CREATE CONFIG FILES
525 +if [ -z "$debian_conffile" ]
527 $ECHO_N "creating configuration files... "$ECHO_C
529 sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
531 chmod 0600 "$PGDATA"/pg_hba.conf "$PGDATA"/pg_ident.conf \
532 "$PGDATA"/postgresql.conf
536 +# debian-conffile option set:
537 +# In a Debian primary installation, the config files go to /etc/postgresql/
538 +# rather than to $PGDATA.
539 +ln -sf /etc/postgresql/pg_hba.conf $PGDATA/pg_hba.conf || exit_nicely
540 +ln -sf /etc/postgresql/pg_ident.conf $PGDATA/pg_ident.conf || exit_nicely
541 +ln -sf /etc/postgresql/postgresql.conf $PGDATA/postgresql.conf || exit_nicely
543 +# Since postgresql.conf is a permanent file, rather than created with the
544 +# database, it must have the LC_ values replaced rather than just tacked
547 + grep -vE '^LC_(MESSAGES|MONETARY|NUMERIC|TIME) *=' /etc/postgresql/postgresql.conf
548 + for cat in MESSAGES MONETARY NUMERIC TIME; do
549 + echo "LC_$cat = '`pg_getlocale $cat`'"
551 +) >/etc/postgresql/$$ || exit_nicely
552 +cat /etc/postgresql/$$ >/etc/postgresql/postgresql.conf || exit_nicely
553 +rm /etc/postgresql/$$
555 +chmod 0600 /etc/postgresql/pg_hba.conf /etc/postgresql/pg_ident.conf
556 +chmod 0644 /etc/postgresql/postgresql.conf
562 ##########################################################################
563 @@ -1143,13 +1179,9 @@
567 -echo "Success. You can now start the database server using:"
569 -echo " $PGPATH/postmaster -D $PGDATA"
571 -# (Advertise -l option here, otherwise we have a background
572 -# process writing to the terminal.)
573 -echo " $PGPATH/pg_ctl -D $PGDATA -l logfile start"
574 +echo "Success. The database server should be started automatically."
575 +echo "If not, you can start the database server using:"
577 +echo " /etc/init.d/postgresql start"
580 diff -ruN postgresql-7.4.6-orig/src/bin/pg_ctl/pg_ctl.sh postgresql-7.4.6-3/src/bin/pg_ctl/pg_ctl.sh
581 --- postgresql-7.4.6-orig/src/bin/pg_ctl/pg_ctl.sh 2004-10-22 02:24:27.000000000 +0200
582 +++ postgresql-7.4.6-3/src/bin/pg_ctl/pg_ctl.sh 2005-03-09 15:56:11.000000000 +0100
583 @@ -139,31 +139,72 @@
589 + if [ -z "$PGDATA" -o `echo x$PGDATA | cut -c1-2` = "x-" ]
591 + echo "$CMDNAME: option '-D' specified without a data directory"
594 # we need to do this so -D datadir shows in ps display
597 + PGDATAOPTS="-D $PGDATA"
603 + if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
605 + echo "$CMDNAME: option '-l' specified without a logfile"
610 logfile=`echo "$1" | sed 's/^-l//'`
611 + if [ -z "$logfile" -o `echo x$logfile | cut -c1-2` = "x-" ]
613 + echo "$CMDNAME: option '-l' specified without a logfile"
619 + if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
621 + echo "$CMDNAME: option '-m' specified without a shutdown mode"
626 shutdown_mode=`echo "$1" | sed 's/^-m//'`
627 + if [ -z "$shutdown_mode" -o `echo x$shutdown_mode | cut -c1-2` = "x-" ]
629 + echo "$CMDNAME: option '-m' specified without a shutdown mode"
635 + if [ -z "$POSTOPTS" ]
637 + echo "$CMDNAME: option '-o' specified without any passed options"
640 + if [ `echo x$POSTOPTS | cut -c1-2` != x- ]
642 + echo "$CMDNAME: option -o must be followed by one or more further options
643 + to pass to the postmaster"
651 + if [ -z "$po_path" -o `echo x$po_path | cut -c1-2` = "x-" ]
653 + echo "$CMDNAME: option '-p' specified without a path"
661 diff -ruN postgresql-7.4.6-orig/src/bin/pg_dump/pg_dump.c postgresql-7.4.6-3/src/bin/pg_dump/pg_dump.c
662 --- postgresql-7.4.6-orig/src/bin/pg_dump/pg_dump.c 2004-05-26 20:27:23.000000000 +0200
663 +++ postgresql-7.4.6-3/src/bin/pg_dump/pg_dump.c 2005-03-09 15:56:11.000000000 +0100
670 /* obsolete as of 7.3: */
671 static Oid g_last_builtin_oid; /* value of the last builtin oid */
673 {"no-owner", no_argument, NULL, 'O'},
674 {"port", required_argument, NULL, 'p'},
675 {"schema", required_argument, NULL, 'n'},
676 + {"convert-now", no_argument, NULL, 'N'},
677 {"schema-only", no_argument, NULL, 's'},
678 {"superuser", required_argument, NULL, 'S'},
679 {"table", required_argument, NULL, 't'},
681 g_comment_end[0] = '\0';
682 strcpy(g_opaque_type, "opaque");
684 - dataOnly = schemaOnly = dumpData = attrNames = false;
685 + dataOnly = schemaOnly = dumpData = attrNames = convertNow = false;
687 progname = get_progname(argv[0]);
693 - while ((c = getopt_long(argc, argv, "abcCdDf:F:h:in:oOp:RsS:t:uU:vWxX:Z:",
694 + while ((c = getopt_long(argc, argv, "abcCdDf:F:h:in:NoOp:RsS:t:uU:vWxX:Z:",
695 long_options, &optindex)) != -1)
699 selectSchemaName = strdup(optarg);
702 + case 'N': /* convert DEFAULT 'now' to DEFAULT now() */
706 case 'o': /* Dump oids */
710 exit_horribly(g_fout, NULL, "could not set extra_float_digits: %s",
711 PQerrorMessage(g_conn));
714 + /* Set datestyle to ISO to ensure portability */
715 + res = PQexec(g_conn, "SET DATESTYLE = ISO");
716 + if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
717 + exit_horribly(g_fout, NULL, "could not set datestyle to ISO: %s",
718 + PQerrorMessage(g_conn));
722 /* Find the last built-in OID, if needed */
724 printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
725 printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
726 printf(_(" -n, --schema=SCHEMA dump the named schema only\n"));
727 + printf(_(" -N, --convert-now convert DEFAULT 'now' to DEFAULT now()\n"));
728 printf(_(" -o, --oids include OIDs in dump\n"));
729 printf(_(" -O, --no-owner do not output commands to set object ownership\n"
730 " in plain text format\n"));
735 + * handleConvertNow: called on DEFAULT arguments in table column definitions;
736 + * if conversion is enabled, returns now() instead of 'now'
739 +handleConvertNow(const char* value)
741 + if( convertNow && !strcmp(value,"'now'"))
748 * selectDumpableNamespace: policy-setting subroutine
749 * Mark a namespace as to be dumped or not
751 @@ -5334,7 +5361,7 @@
752 !tbinfo->inhAttrDef[j] &&
753 !tbinfo->attisserial[j])
754 appendPQExpBuffer(q, " DEFAULT %s",
755 - tbinfo->adef_expr[j]);
756 + handleConvertNow( tbinfo->adef_expr[j] ) );
759 * Not Null constraint --- suppress if inherited
760 diff -ruN postgresql-7.4.6-orig/src/bin/pg_dump/pg_dumpall.c postgresql-7.4.6-3/src/bin/pg_dump/pg_dumpall.c
761 --- postgresql-7.4.6-orig/src/bin/pg_dump/pg_dumpall.c 2004-01-22 20:09:48.000000000 +0100
762 +++ postgresql-7.4.6-3/src/bin/pg_dump/pg_dumpall.c 2005-03-09 15:56:11.000000000 +0100
764 {"globals-only", no_argument, NULL, 'g'},
765 {"host", required_argument, NULL, 'h'},
766 {"ignore-version", no_argument, NULL, 'i'},
767 + {"convert-now", no_argument, NULL, 'N'},
768 {"oids", no_argument, NULL, 'o'},
769 {"port", required_argument, NULL, 'p'},
770 {"password", no_argument, NULL, 'W'},
772 pgdumploc = findPgDump(argv[0]);
773 pgdumpopts = createPQExpBuffer();
775 - while ((c = getopt_long(argc, argv, "acdDgh:iop:sU:vWx", long_options, &optindex)) != -1)
776 + while ((c = getopt_long(argc, argv, "acdDgh:iNop:sU:vWx", long_options, &optindex)) != -1)
781 appendPQExpBuffer(pgdumpopts, " -%c", c);
785 + appendPQExpBuffer(pgdumpopts, " -N");
790 appendPQExpBuffer(pgdumpopts, " -p '%s'", pgport);
792 printf(_(" -g, --globals-only dump only global objects, no databases\n"));
793 printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
794 " pg_dumpall version\n"));
795 + printf(_(" -N, --convert-now convert DEFAULT 'now' to DEFAULT now()\n"));
796 printf(_(" -s, --schema-only dump only the schema, no data\n"));
797 printf(_(" -o, --oids include OIDs in dump\n"));
798 printf(_(" -v, --verbose verbose mode\n"));
799 diff -ruN postgresql-7.4.6-orig/src/include/Makefile postgresql-7.4.6-3/src/include/Makefile
800 --- postgresql-7.4.6-orig/src/include/Makefile 2003-11-25 20:10:15.000000000 +0100
801 +++ postgresql-7.4.6-3/src/include/Makefile 2005-03-10 23:38:56.000000000 +0100
806 - rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
807 - rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
808 + rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_manual.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
809 + rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h port.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
811 rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
813 diff -ruN postgresql-7.4.6-orig/src/include/pg_config_manual.h postgresql-7.4.6-3/src/include/pg_config_manual.h
814 --- postgresql-7.4.6-orig/src/include/pg_config_manual.h 2003-09-21 19:57:21.000000000 +0200
815 +++ postgresql-7.4.6-3/src/include/pg_config_manual.h 2005-03-09 15:56:11.000000000 +0100
817 * here's where to twiddle it. You can also override this at runtime
818 * with the postmaster's -k switch.
820 -#define DEFAULT_PGSOCKET_DIR "/tmp"
821 +#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
824 * Defining this will make float4 and float8 operations faster by
825 diff -ruN postgresql-7.4.6-orig/src/include/port/linux.h postgresql-7.4.6-3/src/include/port/linux.h
826 --- postgresql-7.4.6-orig/src/include/port/linux.h 2003-10-26 02:41:10.000000000 +0100
827 +++ postgresql-7.4.6-3/src/include/port/linux.h 2005-03-09 15:56:11.000000000 +0100
830 #define HAS_TEST_AND_SET
832 +#elif defined(__hppa__)
838 +#define HAS_TEST_AND_SET
841 diff -ruN postgresql-7.4.6-orig/src/include/storage/s_lock.h postgresql-7.4.6-3/src/include/storage/s_lock.h
842 --- postgresql-7.4.6-orig/src/include/storage/s_lock.h 2003-11-04 10:43:56.000000000 +0100
843 +++ postgresql-7.4.6-3/src/include/storage/s_lock.h 2005-03-09 15:56:11.000000000 +0100
845 __asm__ __volatile__(
847 : "=r"(ret), "=m"(*lock)
848 -: "r"(1), "1"(*lock)
849 +: "r"(1), "m"(*lock)
857 +#if defined(__hppa__)
859 + * * HP PA-RISC Linux
861 +#define TAS(lock) tas(lock)
862 +#define TAS_ACTIVE_WORD(lock) ((volatile int *) (((long) (lock) + 15) & ~15))
863 +#define S_UNLOCK(lock) (*TAS_ACTIVE_WORD(lock) = -1)
865 +static __inline__ int
866 +tas(volatile slock_t *lock)
868 + volatile int *lockword = TAS_ACTIVE_WORD(lock);
869 + register int lockval;
871 + __asm__ __volatile__(
872 + " ldcwx 0(0,%2),%0 \n"
873 + : "=r"(lockval), "=m"(*lockword)
875 + return (lockval == 0);
878 +#endif /* __hppa__ */
881 #if defined(__s390__) && !defined(__s390x__)
886 : "=d"(rv), "=m"(*lock)
892 diff -ruN postgresql-7.4.6-orig/src/interfaces/libpq/Makefile postgresql-7.4.6-3/src/interfaces/libpq/Makefile
893 --- postgresql-7.4.6-orig/src/interfaces/libpq/Makefile 2003-09-27 17:32:48.000000000 +0200
894 +++ postgresql-7.4.6-3/src/interfaces/libpq/Makefile 2005-03-09 15:56:11.000000000 +0100
896 SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(THREAD_LIBS)
900 +all: all-lib libpq3-config
902 # Shared library stuff
903 include $(top_srcdir)/src/Makefile.shlib
905 encnames.c wchar.c : % : $(backend_src)/utils/mb/%
906 rm -f $@ && $(LN_S) $< .
909 + sed -e "s|%LIBRARIES%|$(SHLIB_LINK)|" <libpq3-config.in | sed "s/-L[^ ]\+ //" >libpq3-config
911 install: all installdirs install-lib
912 $(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
915 clean distclean maintainer-clean: clean-lib
916 rm -f $(OBJS) crypt.c getaddrinfo.c inet_aton.c snprintf.c strerror.c path.c thread.c dllist.c md5.c ip.c encnames.c wchar.c
917 + rm -f libpq3-config
918 diff -ruN postgresql-7.4.6-orig/src/interfaces/libpq/libpq3-config.in postgresql-7.4.6-3/src/interfaces/libpq/libpq3-config.in
919 --- postgresql-7.4.6-orig/src/interfaces/libpq/libpq3-config.in 1970-01-01 01:00:00.000000000 +0100
920 +++ postgresql-7.4.6-3/src/interfaces/libpq/libpq3-config.in 2005-03-09 15:56:11.000000000 +0100
925 diff -ruN postgresql-7.4.6-orig/src/makefiles/Makefile.linux postgresql-7.4.6-3/src/makefiles/Makefile.linux
926 --- postgresql-7.4.6-orig/src/makefiles/Makefile.linux 2003-06-05 18:07:25.000000000 +0200
927 +++ postgresql-7.4.6-3/src/makefiles/Makefile.linux 2005-03-09 15:56:11.000000000 +0100
929 allow_nonpic_in_shlib = yes
932 -ifeq "$(findstring sparc,$(host_cpu))" "sparc"
939 $(CC) -shared -o $@ $<
940 diff -ruN postgresql-7.4.6-orig/src/pl/plperl/GNUmakefile postgresql-7.4.6-3/src/pl/plperl/GNUmakefile
941 --- postgresql-7.4.6-orig/src/pl/plperl/GNUmakefile 2004-01-21 20:25:11.000000000 +0100
942 +++ postgresql-7.4.6-3/src/pl/plperl/GNUmakefile 2005-03-09 15:56:11.000000000 +0100
947 +# Line addded for Debian - needed for any Linux build, I believe
948 +CFLAGS += -D_GNU_SOURCE
950 # If we don't have a shared library and the platform doesn't allow it
951 # to work without, we have to skip it.
952 ifneq (,$(findstring yes, $(shared_libperl)$(allow_nonpic_in_shlib)))
953 diff -ruN postgresql-7.4.6-orig/src/test/regress/pg_regress.sh postgresql-7.4.6-3/src/test/regress/pg_regress.sh
954 --- postgresql-7.4.6-orig/src/test/regress/pg_regress.sh 2003-11-02 22:56:15.000000000 +0100
955 +++ postgresql-7.4.6-3/src/test/regress/pg_regress.sh 2005-03-09 15:56:11.000000000 +0100
961 + echo "unix_socket_directory = '/tmp'" >>$PGDATA/postgresql.conf
962 + psql_options="$psql_options --host=/tmp"
967 diff -ruN postgresql-7.4.6-orig/src/tutorial/Makefile postgresql-7.4.6-3/src/tutorial/Makefile
968 --- postgresql-7.4.6-orig/src/tutorial/Makefile 2002-09-05 20:28:46.000000000 +0200
969 +++ postgresql-7.4.6-3/src/tutorial/Makefile 2005-03-09 15:56:11.000000000 +0100
974 +# Please note that this Makefile was modified for Debian to allow
975 +# compilation in an arbitrary directory and without the complete
976 +# PostgreSQL source tree.
977 #-------------------------------------------------------------------------
979 -subdir = src/tutorial
980 -top_builddir = ../..
981 -include $(top_builddir)/src/Makefile.global
983 -override CFLAGS+= $(CFLAGS_SL)
984 -SHLIB_LINK = $(BE_DLLLIBS)
987 +INCLUDES= -I/usr/include/postgresql/ -I/usr/include/postgresql/server/
991 # DLOBJS are the dynamically-loaded object files. The "funcs" queries
992 # include CREATE FUNCTIONs that load routines from these files.
995 all: $(DLOBJS) $(QUERIES)
998 + $(CC) -shared -o $@ $<
1005 clean distclean maintainer-clean:
1006 rm -f $(DLOBJS) $(QUERIES)
1008 +.PHONY: clean distclean maintainer-clean
1009 diff -ruN postgresql-7.4.6-orig/src/tutorial/README postgresql-7.4.6-3/src/tutorial/README
1010 --- postgresql-7.4.6-orig/src/tutorial/README 2001-10-26 22:45:33.000000000 +0200
1011 +++ postgresql-7.4.6-3/src/tutorial/README 2005-03-09 15:56:11.000000000 +0100
1014 to compile all the scripts and C files for the user-defined functions
1015 and types. (make needs to be GNU make --- it may be named something
1016 -different on your system, often gmake)
1017 +different on your system, often gmake.) The package postgresql-dev
1018 +must be installed for the tutorials to compile.
1020 Then, run psql with the -s (single-step) flag:
1023 From within psql, you can try each individual script file by using
1024 psql's \i <filename> command.
1026 +Please note that you need database superuser privileges to execute the
1027 +examples which load dynamic libraries ('funcs' and 'complex') since
1028 +the language C is usually not 'trusted', i. e. may not be used by