Allow COPY from STDIN to absorb all input before throwing an error

From: Decibel! <decibel(at)decibel(dot)org>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow COPY from STDIN to absorb all input before throwing an error
Date: 2008-04-08 20:26:24
Message-ID: 17145E90-F359-42FD-A5A8-A777237F57A5@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When restoring from pg_dump(all), if a problem occurs in a COPY
command you're going to get a whole slew of errors, because as soon
as COPY detects a problem it will throw an error and psql will
immediately switch to trying to process the remaining data that was
meant for COPY as if it was psql commands. This is confusing and
annoying at best; it could conceivably trash data at worst (picture
dumping a table that had SQL commands in it).

My idea to avoid this situation is to add an option to COPY that
tells it not to throw an error until it runs out of input data. Of
course once it finds a problem it would just throw all the input data
away, but when used in the context of a dump file this would remove
all the bogus errors that either psql or the backend will generate
when trying to process table data as if it was commands.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-04-08 20:32:03 Re: [PATCHES] libpq type system 0.9a
Previous Message Martijn van Oosterhout 2008-04-08 20:19:10 Re: [PATCHES] libpq type system 0.9a