Re: [INTERFACES] how to obtain column info - Mailing list pgsql-interfaces

From Cary B. O'Brien
Subject Re: [INTERFACES] how to obtain column info
Date
Msg-id 199811110134.UAA07958@access1.digex.net
Whole thread Raw
In response to how to obtain column info  ("Ken J. Wright" <ken@ori-ind.com>)
Responses Re: [INTERFACES] how to obtain column info  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-interfaces
> With libpq, how do you obtain column info (like type) for a table *before*
> returning a result set? For instance, knowing the column type before
> constructing an insert statement. A date will need quotes, a number won't,
> a string will, etc.
>

I usually do a 'select * from table_x where oid < 0' or something like
that to get an empty result set.  This might be a stupid thing to do on
a big table, thought.  You might want to select a column with an index.
Anyone have a better idea?

Actually, you should be able to get the information out of the pg_ tables.

-- cary

pgsql-interfaces by date:

Previous
From: "Bryan White"
Date:
Subject: Re: [INTERFACES] how to obtain column info
Next
From: Brett McCormick
Date:
Subject: Re: [INTERFACES] how to obtain column info