Re: error messages without schema name - Mailing list pgsql-general

From Shoaib Mir
Subject Re: error messages without schema name
Date
Msg-id bf54be870612130628i4470ab15l2355bdc680cb7471@mail.gmail.com
Whole thread Raw
In response to error messages without schema name  ("Filip Rembiałkowski" <plk.zuber@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: dananrg@yahoo.com
Date:
Subject: Re: TOAD-like query builder for PostgreSQL?
Next
From: "William Leite Araújo"
Date:
Subject: Re: A VIEW mimicing a TABLE