Re: [HACKERS] psql and COPY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] psql and COPY
Date: 2000-01-18 23:28:19
Message-ID: Pine.LNX.4.21.0001180209140.411-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry, I can't reproduce that. I have not been able to keep up with RI, so
I can't seem to get a usable table configuration together. I used a script

COPY three FROM STDIN;
\N
\.

on a table CREATE TABLE three ( a int4 not null ) and it gives me proper
error messages either way.

I am almost tempted to say that this is a bug in COPY, though I sure don't
want to blame anyone before I see it. Could you send me a complete test
case please?

-Peter

On 2000-01-17, Oliver Elphick mentioned:

> Peter, there seem to be problems with the COPY statement when psql is run
> with redirected stdin.
>
> If I have a file ${DUMPDIR}/dbdump.product containing:
>
> COPY product FROM stdin;
> 05 \N 000000 \N \N S D9 t f f f POLY BAGS-BLACK . Single f
> ...
> \.
>
>
> and I run this command:
> psql -e -d bray < ${DUMPDIR}/dbdump.product
>
> no error messages are seen.
>
> If I remove the COPY command from the file and run the COPY frpm inside
> psql, I see the errors:
>
> bray=> copy product from '/tmp/dbdump.product';
> ERROR: <unnamed> referential integrity violation - key referenced from
> product not found in brandname
>
>

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-01-18 23:28:27 Re: [HACKERS] Foreign keys: unexpected result from ALTER TABLE... ADD CONSTRAINT...
Previous Message Peter Eisentraut 2000-01-18 23:28:10 Re: [HACKERS] TODO list