psql and COPY

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Peter Eisentraut <e99re41(at)DoCS(dot)UU(dot)SE>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: psql and COPY
Date: 2000-01-17 14:34:06
Message-ID: 200001171434.OAA01785@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"And, behold, I come quickly; and my reward is with me,
to give every man according as his work shall be."
Revelation 22:12

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Theo Kramer 2000-01-17 14:43:04 Re: [HACKERS] DefineQueryRewrite: rule plan string too big.
Previous Message Theo Kramer 2000-01-17 14:28:43 DefineQueryRewrite: rule plan string too big.