pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedprogramatically obtaining table layout
2+ messages / 2 participants
[nested] [flat]
* programatically obtaining table layout
@ 2002-08-22 09:00 Philip Rudling <psr@clara.net>
2002-08-29 12:50 ` Re: programatically obtaining table layout Mark McEahern <marklists@mceahern.com>
0 siblings, 1 reply; 2+ messages in thread
From: Philip Rudling @ 2002-08-22 09:00 UTC (permalink / raw)
To: pgsql-admin
Is there a way of getting the output of a \d tablename from within a
program (like describe in mysql)
Although this works fine from the postgres command line, from within a
program I get:
ODBC Error Code = 00000 ()
Error while executing the query (non-fatal); ERROR: parser: parse error at
or near "\"
SQL = "\d orders"
Data Source = "MESSINA"
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (4:1) to (7:39) in the template file
/usr/local/apache/htdocs/stephen/messina/TESTER.cfm.
I am using coldfusion and unix ODBC driver.
SR
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: programatically obtaining table layout
2002-08-22 09:00 programatically obtaining table layout Philip Rudling <psr@clara.net>
@ 2002-08-29 12:50 ` Mark McEahern <marklists@mceahern.com>
0 siblings, 0 replies; 2+ messages in thread
From: Mark McEahern @ 2002-08-29 12:50 UTC (permalink / raw)
To: pgsql-admin
> 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
-
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-08-29 12:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-22 09:00 programatically obtaining table layout Philip Rudling <psr@clara.net>
2002-08-29 12:50 ` Mark McEahern <marklists@mceahern.com>
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