Re: Getting a list of fields in a table... - Mailing list pgsql-general

From Mitch Vincent
Subject Re: Getting a list of fields in a table...
Date
Msg-id 002c01c0d4ff$dd7cb360$1251000a@windows
Whole thread Raw
In response to Re: Getting a list of fields in a table...  (Frank Miles <fpm@u.washington.edu>)
List pgsql-general
Use psql -E, that will show you the queries the commands generate (try \d
<tablename> and check out the query)..

-Mitch

----- Original Message -----
From: "Frank Miles" <fpm@u.washington.edu>
To: "Rich Henry" <rhenry@mvcc.edu>
Cc: <pgsql-general@postgresql.org>
Sent: Friday, May 04, 2001 8:20 PM
Subject: Re: Getting a list of fields in a table...


> > I'm looking for a solution to getting the fields in a table without
> > running some random query on the system, can anyone share
> > the SQL with me to get this done and anything special that would
> > need to be done with libpq would also be appreciated...
>
> Dear Rich:
>
> Sorry this isn't a complete answer.  If you really need SQL
> (rather than \d inside psql) there is a way to find out the SQL commands
> psql uses to perform its special commands.  This subject has been on
> the newsgroup in the "recent past" -- sorry, don't have anything exact.
> Alternatively you can invoke psql with a shell script, something like:
> psql -s <database name> -t <table name>
> which will cause the schema to be sent to stdout.  I'm not sure what
> you want to do via libpq, though once you have the SQL strings you could
> use any number of methods to access the schema.
>
> Hope this helps!
>
> -frank
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: IpcMemoryCreate: shmget failed (Invalid argument)
Next
From: "John Clark L. Naldoza"
Date:
Subject: Re: how to start postgresql server ( or postmaster ) automatically