Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] libpq PQftype() to comprehend types?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Olivier <mo(at)local2me(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] libpq PQftype() to comprehend types?
Date: 1999-03-12 01:59:23
Message-ID: 22079.921203963@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Michael Olivier <mo(at)local2me(dot)com> writes:
> Can someone tell me how I can use PQftype() or some other mechanism to
> interpret a query result in terms of the data types of the columns?

The PQftype value is the OID of the row for the type in the system
pg_type catalog.  Try

	SELECT * FROM pg_type WHERE oid = <PQftype result>

BTW: oid's for the predefined types are consistent across installations,
but oid's for user-defined types are not (and shouldn't even be trusted
across a save/reload).

			regards, tom lane

pgsql-interfaces by date

Next:From: Ries van TwiskDate: 1999-03-12 06:32:14
Subject: Postgres and ODBC with MS-Access memory problem
Previous:From: Claudio CicognaniDate: 1999-03-11 18:46:42
Subject: Looking for a software library

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group