Re: COPY seems to work, but no data in the table - Mailing list pgsql-general

From Joe Conway
Subject Re: COPY seems to work, but no data in the table
Date
Msg-id 3D34F0A6.3070303@joeconway.com
Whole thread Raw
In response to Re: COPY seems to work, but no data in the table  (nconway@klamath.dyndns.org (Neil Conway))
List pgsql-general
Tom Lane wrote:
 > ERROR:  $1 referential integrity violation - key referenced from bar
 > not found in foo
 > lost synchronization with server, resetting connection
 > regression=#
 >
 > I believe it works the same way in 7.2.1, but don't have an
 > exactly-7.2.1-release code tree handy to check.  (This is a post-7.2
 > bug fix though, 7.2 will fail :-()

I do:

test=# select version();
                            version
-------------------------------------------------------------
  PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

test=# create table foo(f1 int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
'foo_pkey' for table 'foo'
CREATE
test=# create table bar(f2 int references foo);
NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
CREATE
test=# copy bar from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
 >> 1
 >> \.
ERROR:  <unnamed> referential integrity violation - key referenced from
bar not found in foo
lost synchronization with server, resetting connection

Same result.

Joe



pgsql-general by date:

Previous
From: "Tracy Gong"
Date:
Subject: ? about Installation of Postgresql
Next
From: "Phil Geer"
Date:
Subject: Re: Logging SQL queries?