Question Again - Mailing list pgsql-general

From Cristian D. GAL
Subject Question Again
Date
Msg-id Pine.LNX.4.21.0009061851020.3911-100000@papaya.opsynet.com
Whole thread Raw
In response to Re: Question  ("Adam Lang" <aalang@rutgersinsurance.com>)
List 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 by date:

Previous
From: Frank Bax
Date:
Subject: Re: Question
Next
From: "Trewern, Ben"
Date:
Subject: Documentation of system tables.