Re: [HACKERS] INT2OID, etc. - Mailing list pgsql-hackers

From Vadim B. Mikheev
Subject Re: [HACKERS] INT2OID, etc.
Date
Msg-id 34F64BE9.8F29F120@sable.krasnoyarsk.su
Whole thread Raw
In response to INT2OID, etc.  (darcy@druid.net (D'Arcy J.M. Cain))
Responses Re: [HACKERS] INT2OID, etc.  (Brett McCormick <brett@work.chicken.org>)
Re: [HACKERS] INT2OID, etc.  (darcy@druid.net (D'Arcy J.M. Cain))
List pgsql-hackers
D'Arcy J.M. Cain wrote:
>
> I am enhancing my PyGreSQL 2.0 package and I wanted to determine the
> types of returned fields.  I tried using the manifest constans
> INT2OID, INT4OID, FLOAT4OID, etc but these are defined in the
> file src/include/catalog/pg_type.h which doesn't get installed
> into the public include directory.  Am I right in assuming that
> external programs shouldn't use these values?  Is there another
> way to get what I want?  Is it considered acceptable for interface
> programs to use this header file?  Inquiring minds want to know.

On the one hand, client applications/interfaces shouldn't use
server internal constants like these but query database to get
type' name using type OIDs (like pg_dump does for \d-s).

On the other hand - performance! And ability to use constants
for built-in types is good thing.

I like second way (and so - we should copy pg_type to ~pgsql/include or
something like this) but it would be nice if you support more
general 1st way too.

Vadim

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] INT2OID, etc.
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Platforms with v6.3 trouble