Question Again

Поиск
Список
Период
Сортировка
От Cristian D. GAL
Тема Question Again
Дата
Msg-id Pine.LNX.4.21.0009061851020.3911-100000@papaya.opsynet.com
обсуждение исходный текст
Ответ на Re: Question  ("Adam Lang" <aalang@rutgersinsurance.com>)
Список pgsql-general
>> is there a solution to find infos about a table?
>> eg: I want to know what field names and their types has a certain table
>> from a db.

I read TFM and found -c option to 'psql' and came up with this trick:

#!/some/where/perl
use CGI qw(:standard);

my $table = param('table');
my $fields = `psql $DBNAME -h $DBHOST -U $DBUSER -c \"\\d $table\" -q`;
print $fields;
..

is there something a little more elegant than this?

Cristian GAL
gal@mail.com



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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: Question
Следующее
От: "Trewern, Ben"
Дата:
Сообщение: Documentation of system tables.