From: Mark McEahern <marklists@mceahern.com>
To: pgsql-admin@postgresql.org
Subject: Re: programatically obtaining table layout
Date: Thu, 29 Aug 2002 07:50:41 -0500
Message-ID: <JHEOKEOOLIGLDHCMAHMOMEBFDLAA.marklists@mceahern.com> (raw)
In-Reply-To: <1030006940.22212.0@iris.uk.clara.net>
> Is there a way of getting the output of a \d tablename from within a
> program (like describe in mysql)
If I understand your question correctly, you mean how do I do what this
does:
psql -c "\d $tablename" $dbname $username
Try this:
psql --help
Notice the -E option:
-E Display queries that internal commands generate
So:
psql -c "\d $tablename" -E $dbname $username
Cheers,
// mark
-
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: marklists@mceahern.com
Subject: Re: programatically obtaining table layout
In-Reply-To: <JHEOKEOOLIGLDHCMAHMOMEBFDLAA.marklists@mceahern.com>
References: <1030006940.22212.0@iris.uk.clara.net> <JHEOKEOOLIGLDHCMAHMOMEBFDLAA.marklists@mceahern.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox