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