pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpq PQftype() to comprehend types?
2+ messages / 2 participants
[nested] [flat]

* libpq PQftype() to comprehend types?
@ 1999-03-11 18:44 Michael Olivier <mo@local2me.com>
  1999-03-12 01:59 ` Re: [INTERFACES] libpq PQftype() to comprehend types? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Michael Olivier @ 1999-03-11 18:44 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: michael@local2me.com

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?


I need to be able to tell what data type a given column is. The 6.3.2
manual says PQftype() returns an internal coding -- is this defined in a
header file I can access, or ... ?

thanks,
Michael



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] libpq PQftype() to comprehend types?
  1999-03-11 18:44 libpq PQftype() to comprehend types? Michael Olivier <mo@local2me.com>
@ 1999-03-12 01:59 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 1999-03-12 01:59 UTC (permalink / raw)
  To: Michael Olivier <mo@local2me.com>; +Cc: pgsql-interfaces

Michael Olivier <mo@local2me.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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-03-12 01:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-11 18:44 libpq PQftype() to comprehend types? Michael Olivier <mo@local2me.com>
1999-03-12 01:59 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox