pgsql-server: They are two different problems; the TOC entry is

From: momjian(at)svr1(dot)postgresql(dot)org (Bruce Momjian)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server: They are two different problems; the TOC entry is
Date: 2004-08-20 20:00:34
Message-ID: 20040820200034.6F4115E46E0@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
They are two different problems; the TOC entry is important for any
multiline command or to rerun the command easily later.

Whereas displaying the failed SQL command is a matter of fixing the
error
messages.

The latter is complicated by failed COPY commands which, with
die-on-errors
off, results in the data being processed as a command, so dumping the
command will dump all of the data.

In the case of long commands, should the whole command be dumped? eg.
(eg.
several pages of function definition).

In the case of the COPY command, I'm not sure what to do. Obviously, it
would be best to avoid sending the data, but the data and command are
combined (from memory). Also, the 'data' may be in the form of INSERT
statements.

Attached patch produces the first 125 chars of the command:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC Entry 26; 1255 16449270
FUNCTION
plpgsql_call_handler() pjw
pg_restore: [archiver (db)] could not execute query: ERROR: function
"plpgsql_call_handler" already exists with same argument types
Command was: CREATE FUNCTION plpgsql_call_handler() RETURNS
language_handler
AS '/var/lib/pgsql-8.0b1/lib/plpgsql', 'plpgsql_call_han...
pg_restore: [archiver (db)] Error from TOC Entry 27; 1255 16449271
FUNCTION
plpgsql_validator(oid) pjw
pg_restore: [archiver (db)] could not execute query: ERROR: function
"plpgsql_validator" already exists with same argument types
Command was: CREATE FUNCTION plpgsql_validator(oid) RETURNS void
AS '/var/lib/pgsql-8.0b1/lib/plpgsql', 'plpgsql_validator'
LANGU...

Philip Warner

Modified Files:
--------------
pgsql-server/src/bin/pg_dump:
pg_backup_archiver.c (r1.93 -> r1.94)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_dump/pg_backup_archiver.c.diff?r1=1.93&r2=1.94)
pg_backup_archiver.h (r1.59 -> r1.60)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_dump/pg_backup_archiver.h.diff?r1=1.59&r2=1.60)
pg_backup_db.c (r1.54 -> r1.55)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_dump/pg_backup_db.c.diff?r1=1.54&r2=1.55)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2004-08-20 20:07:12 pgsql-server: Add ALTER SCHEMA item detail: < o Allow databases,
Previous Message Bruce Momjian 2004-08-20 19:48:14 pgsql-server: I notice that contrib/fuzzystrmatch/dmetaphone.c doesn't