Allow COPY from STDIN to absorb all input before throwing an error - Mailing list pgsql-hackers

From Decibel!
Subject Allow COPY from STDIN to absorb all input before throwing an error
Date
Msg-id 17145E90-F359-42FD-A5A8-A777237F57A5@decibel.org
Whole thread Raw
Responses Re: Allow COPY from STDIN to absorb all input before throwing an error  (Neil Conway <neilc@samurai.com>)
Re: Allow COPY from STDIN to absorb all input before throwing an error  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [PATCHES] libpq type system 0.9a
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] libpq type system 0.9a