FOREIGN KEY

From: "Andras Balogh" <abalogh(at)grafx(dot)ro>
To: <pgsql-general(at)postgresql(dot)org>
Subject: FOREIGN KEY
Date: 2001-07-04 13:45:58
Message-ID: 002b01c1048f$a8bba9f0$0d00a8c0@grafx.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have created a table is postgres with a FOREIGN KEY reference to
another table.
I am using the COPY command to copy the data from a file to this table.
I am getting this error:
referential integrity violation - key referenced from A not found in B

I understand that I am inserting a row in A with an id that is not in table B,
I want to ignore those inserts that are violating the referential integrity.
What should i do?

Aslo i didn't find a way to list the FOREIGN KEYS in a table
\d <tablename> it gives only the structure.

Any input is welcomed,

Andras.

Browse pgsql-general by date

  From Date Subject
Next Message Fariba Noorbakhsh 2001-07-04 13:53:39 Table Description!!
Previous Message Martín Marqués 2001-07-04 13:42:43 TODO item