You can not truncate table 'foo' because there is referential integrity between 'foo' and 'bar', so try using
TRUNCATE nsp2.foo CASCADE;
You can find the schema name for 'bar' using a query like:
select nspname from pg_namespace where oid = (select relnamespace from pg_class where relname = 'bar');
-------------------------
Shoaib Mir
EnterpriseDB (
www.enterprisedb.com)
On 12/13/06, Filip Rembiałkowski <plk.zuber@gmail.com> wrote:Hi all,
I heard once that all messages which refer to table names should also
give their schema name.
I mean, if I see something like
rzeznia=# TRUNCATE nsp2.foo;
ERROR: cannot truncate a table referenced in a foreign key constraint
DETAIL: Table "bar" references "foo".
HINT: Truncate table "bar" at the same time, or use TRUNCATE ... CASCADE.
I do not know which namespace "bar" belongs to.
Is this a bug, or do I have to live with it?
--
Filip Rembiałkowski
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly