agora inbox for pgsql-interfaces@postgresql.org  
help / color / mirror / Atom feed
Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client?
2+ messages / 2 participants
[nested] [flat]

* Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client?
@ 2013-12-05 20:43 Hoon H. <drawtree@gmail.com>
  2013-12-05 23:27 ` Re: Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Hoon H. @ 2013-12-05 20:43 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: Hoon H. <drawtree@gmail.com>

Hello folks.

I am writing a C/C++ program which uses `libpq`. I am stuck at getting result from PQresult because I want to parse text from result automatically by its type OID value. But it's unclear how I should handle type informations. 
What I need is only fundamental built-in types - boolean, int, float, text, timestamp, binary. Maybe adding some system required system - such as OID type itself. The problem is OID constant values for built-in types are not defined in client-side.

According to some mailing list entries, 

http://www.postgresql.org/message-id/20080708000535.GA10491@cuci.nl
http://www.postgresql.org/message-id/AANLkTimiNjQa7ws1tyR_W6RQPec6RlxQtWfACNMnZ_1P@mail.gmail.com

It seems safe to use macros defined in `server/catalog/pg_type.h`, but I still doubt because I couldn't find any official policy on these values. 
Though I agree people on the mailing list entries, but still this is completely up to dev-team's decision. Can I ask some official policy on these values - OID values for built-in types?

If there's some publicly existing policy, please drop me some link. It's too hard to find it.

-- 
Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces



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

* Re: Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client?
  2013-12-05 20:43 Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client? Hoon H. <drawtree@gmail.com>
@ 2013-12-05 23:27 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2013-12-05 23:27 UTC (permalink / raw)
  To: Hoon H. <drawtree@gmail.com>; +Cc: pgsql-interfaces

"Hoon H." <drawtree@gmail.com> writes:
> According to some mailing list entries, 

> http://www.postgresql.org/message-id/20080708000535.GA10491@cuci.nl
> http://www.postgresql.org/message-id/AANLkTimiNjQa7ws1tyR_W6RQPec6RlxQtWfACNMnZ_1P@mail.gmail.com

> It seems safe to use macros defined in `server/catalog/pg_type.h`, but I still doubt because I couldn't find any official policy on these values. 

We never have changed the OIDs of those basic types, and I doubt we would.
We're well aware that some client code knows their numbers.

			regards, tom lane


-- 
Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces



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


end of thread, other threads:[~2013-12-05 23:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-12-05 20:43 Is it safe to use fundamental type OIDs defined in server/catalog/pg_type.h from client? Hoon H. <drawtree@gmail.com>
2013-12-05 23:27 ` Tom Lane <tgl@sss.pgh.pa.us>

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