How can I find the schema that a table belongs to?

Поиск
Список
Период
Сортировка
От Jerry LeVan
Тема How can I find the schema that a table belongs to?
Дата
Msg-id 1295454373.17208.21.camel@linuxbox.skynet
обсуждение исходный текст
Ответы Re: How can I find the schema that a table belongs to?
Список pgsql-general
Hi,

I am trying to tidy up my perl script that runs as a cgi and allows
remote users (aka me) to interact with my Pg database.

I primarily want to  use this tool as a way for my iPad to
browse my data base. It seems to be working quite well but
one certainly does not want to 'select * from ginormous_table'.

I am trying to build a 'describe' function. ie if the user
types "describe tablename" in the sql box I want to display
some interesting attributes for that table, mainly names and
data types for each of the columns.

I have done this in other programs but I forced the user
to specify a schema qualified name ( and mimiced what psql -E
did).

So I guess the question is:
   Given a bare table name, how can I recover the schema
   qualified name with whatever the current search path happens
   to be?

   This task has to be done using  simple sql from the perl dbi.

Thanks,

Jerry



В списке pgsql-general по дате отправления:

Предыдущее
От: Lonni J Friedman
Дата:
Сообщение: Re: Anyone use PG with kvm/virtio? Any gotchas or recommended settings?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Error during a dump (ts_selectivity, not found)