Extracting fieldnames from a TABLE

Поиск
Список
Период
Сортировка
От Erik Wasser
Тема Extracting fieldnames from a TABLE
Дата
Msg-id 200409011714.49671.erik.wasser@iquer.net
обсуждение исходный текст
Ответы Re: Extracting fieldnames from a TABLE
Список pgsql-sql
Hi community,

I would like to retrieve all the fieldnames of a given table. In the 
perl module Tie::DBI[1] i found the following fragment:
  $dbh->prepare("LISTFIELDS $table");

in the case the DB supports this (Tie::DBI thinks so for Pg) or the 
alternative is:
  $dbh->prepare("SELECT * FROM $table WHERE 0=1");

The first one doesn't work in my PostgreSQL 7.4.3:

% LISTFIELDS foobar;
ERROR:  syntax error at or near "LISTFIELDS" at character 1
%

and the seconds one looks ugly. Is there a solution for the problem?

Greetings

[1]http://search.cpan.org/~lds/Tie-DBI-0.93/lib/Tie/DBI.pm

-- 
So long... Fuzz


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

Предыдущее
От: Michael Kleiser
Дата:
Сообщение: Re: German "umlaut insensitive" query
Следующее
От: Robert Strötgen
Дата:
Сообщение: Re: German "umlaut insensitive" query