Information about columns

Поиск
Список
Период
Сортировка
От Dario Teixeira
Тема Information about columns
Дата
Msg-id 44257.28393.qm@web111506.mail.gq1.yahoo.com
обсуждение исходный текст
Ответы Re: Information about columns  (Craig Ringer <craig@postnewspapers.com.au>)
Re: Information about columns  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Hi,

Is there some way to find out meta-information about the columns generated
by any SELECT query?  If the SELECT returns values from a regular table or
a view, I can use pg_class and pg_attribute to get the info I need:

CREATE TABLE foobar (quant int);
SELECT quant FROM foobar;
SELECT attname, attnum FROM pg_attribute, pg_class WHERE attrelid=pg_class.oid AND relname='foobar';

But what if the columns belong to a "virtual" table instead, as per the
(silly) example below?

SELECT 1, 2*quant FROM foobar;

Thanks in advance for any help you might give me!
Best regards,
Dario Teixeira





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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: running pg_dump from python
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Information about columns