Re: Column names and datatypes - Mailing list pgsql-general

From Mike Mascari
Subject Re: Column names and datatypes
Date
Msg-id 40A52253.3070504@mascari.com
Whole thread Raw
In response to Column names and datatypes  (Glenn Sullivan <glenn.sullivan@varianinc.com>)
List pgsql-general
Glenn Sullivan wrote:

> I need to acquire the list of all column names and datatypes
> from a table through the JDBC interface using an sql command.
> What I want is available in "psql" with the "\d tablename"
> command, but I cannot figure out how to get these via an sql
> command.  Can anyone help?

You can either query the information_schema's tables and views, or
you can start psql with the '-E' switch and view the queries its
sending and modify them to fit your requirements.

http://www.postgresql.org/docs/7.4/static/information-schema.html

HTH,

Mike Mascari


pgsql-general by date:

Previous
From: "Carl E. McMillin"
Date:
Subject: Re: Column names and datatypes
Next
From: Gaetano Mendola
Date:
Subject: Re: slow query if add order by