Search Postgresql Archives

Re: knowing which table/schema is going to be chosen

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

 



Ivan Sergio Borgonovo wrote:
> I have a search_path that may not just consist of $user, public.
> eg.
> $user, public, test, import
> 
> I'd like to know which table is going to be chosen if I do a
> select * from mytable;

> Is there a way to ask postgresql the schema of the table that will be
> chosen?

Hmm - I don't know of a specific function. You could do something like
this though:

SELECT nspname FROM pg_namespace
WHERE oid = (
  SELECT relnamespace FROM pg_class
  WHERE oid = 'mytable'::regclass::oid
);

-- 
  Richard Huxton
  Archonet Ltd

-- 
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