Re: Getting fields in a table through a query?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Getting fields in a table through a query?
Дата
Msg-id 24946.1012923861@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Getting fields in a table through a query?  ("Mitch Vincent" <mitch@doot.org>)
Список pgsql-general
"Mitch Vincent" <mitch@doot.org> writes:
> How can I get the fields in a given table via an SQL query even if there are
> no records in that table? I just need the names of all the fields in a
> table -- is that even possible?

Why not just
    select * from foo where false;
and examine the column names that come back?  Lack of any data will not
stop the system from sending column headers.

            regards, tom lane

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

Предыдущее
От: "Ben-Nes Michael"
Дата:
Сообщение: caculating while select - maybe sum ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: rule on update