Search Postgresql Archives

Re: regclass and search_path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joe Abbate <jma@xxxxxxxxxxxxxxxxx> writes:
> I'm using this to validate a tool I'm building and I get an error on the 
> following query:

> autodoc=> SELECT conname::regclass FROM pg_constraint
> autodoc->       WHERE contype = 'u';
> ERROR:  relation "product_product_code_key" does not exist

Ummm ... pg_constraint.conname contains a constraint name, not a table
name, so casting it to regclass is highly likely to fail.  This hasn't
got anything to do with search_path AFAICS, it's just a thinko.

Depending on what it is that you're hoping to do, any of conrelid,
confrelid, or conindid might be what you're after.  All of those columns
would contain pg_class OIDs that could usefully be cast to regclass.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux