Re: oid data types mapping in libpq functions

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: zhong ming wu <mr(dot)z(dot)m(dot)wu(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: oid data types mapping in libpq functions
Date: 2010-06-17 14:32:01
Message-ID: AANLkTimiNjQa7ws1tyR_W6RQPec6RlxQtWfACNMnZ_1P@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jun 16, 2010 at 10:42 PM, zhong ming wu <mr(dot)z(dot)m(dot)wu(at)gmail(dot)com> wrote:
> Dear List
>
> Where can I find this mapping of oid to pg data types mentioned in
> libpq documentation?
> Why is such information not mentioned in the documentation?  A general
> knowledge?

curious: what do you need the oids for?

built in type oids are defined in pg_type.h:
cat src/include/catalog/pg_type.h | grep OID | grep define

built in type oids don't change. you can pretty much copy/pasto the
output of above into an app...just watch out for some types that may
not be in older versions.

user defined type oids (tables, views, composite types, enums, and
domains) have an oid generated when it is created. since that oid can
change via ddl so you should look it up by name at appropriate times.

if you want to be completely abstracted from the type oids, look here:
http://libpqtypes.esilo.com/

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2010-06-17 14:35:26 Re: postgres crash SOS
Previous Message Adrian Klaver 2010-06-17 14:14:53 Re: oid data types mapping in libpq functions