Skip site navigation (1) Skip section navigation (2)

missing foreign key fails silently using COPY

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-bugs(at)postgresql(dot)org
Subject: missing foreign key fails silently using COPY
Date: 2002-02-25 00:58:32
Message-ID: slrna7j2ti.au.missive@whave.frontiernet.net (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
When COPYing data to a table which uses foreign keys, if there
is a reference to a key which is not there, the copy fails
(as expected) but there is no error message.

Hmm. Looking at it more, seems like there is an error message
when using:
COPY "f" FROM '/home/lee/f.dat';

but _not_ when using:
COPY "f" FROM stdin;
or
\copy f from f.dat


This is on:
 PostgreSQL 7.2 on i386-unknown-freebsd4.5, compiled by GCC 2.95.3


SELECT version();

DROP TABLE p;
DROP TABLE f;

CREATE TABLE p (
 pk int primary key
);

CREATE TABLE f (
 fk int references p
);

COPY "p" FROM stdin;
1
2
3
4
\.

COPY "f" FROM stdin;
1
2
3
4
5
\.



Responses

pgsql-hackers by date

Next:From: Fernando NasserDate: 2002-02-25 01:11:43
Subject: Re: [HACKERS] Updated TODO item
Previous:From: Andrew McMillanDate: 2002-02-25 00:09:07
Subject: Re: Duration of beta period

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2002-02-25 01:48:14
Subject: Bug #602: Chinese characters query bug.
Previous:From: Tom LaneDate: 2002-02-24 03:19:33
Subject: Re: [PATCHES] COPY when 'filename' is a directory

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group