Re: [INTERFACES] how to obtain column info

From: "Cary B(dot) O'Brien" <cobrien(at)access(dot)digex(dot)net>
To: ken(at)ori-ind(dot)com (Ken J(dot) Wright)
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] how to obtain column info
Date: 1998-11-11 01:34:47
Message-ID: 199811110134.UAA07958@access1.digex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Brett McCormick 1998-11-11 05:33:15 Re: [INTERFACES] how to obtain column info
Previous Message Bryan White 1998-11-11 01:28:15 Re: [INTERFACES] how to obtain column info