Re: Truncate and Foreign Key Constraint question

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Truncate and Foreign Key Constraint question
Date: 2006-04-13 05:45:47
Message-ID: 71E37EF6B7DCC1499CEA0316A2568328024BC2E2@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doh ! A test schema that was a left over. Thanks for the sanity check ... as usual, pilot error!

g

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wed 4/12/2006 10:02 PM
To: Gregory S. Williamson
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Truncate and Foreign Key Constraint question

"Gregory S. Williamson" <gsw(at)globexplorer(dot)com> writes:
> As the sequence below shows, I dropped the FK constraint successfully, but when I run TRUNCATE collections_l it says:
> ERROR: cannot truncate a table referenced in a foreign key constraint
> DETAIL: Table "client_collect_rates" references "collections_l" via foreign key constraint "$2".

Hm, works for me. Is it possible that you've got multiple
client_collect_rates tables in different schemas, and it's complaining
about some other one? The error message doesn't show the schema of the
table ...

regards, tom lane

!DSPAM:443ddb4b66027357040552!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Harald Armin Massa 2006-04-13 05:50:13 how can I create the DML for an existing database - within an application
Previous Message Yanni Chiu 2006-04-13 05:31:12 Re: Select first ten of each category?