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

From Bruce Momjian
Subject Re: [HACKERS] INT2OID, etc.
Date
Msg-id 199802270446.XAA25942@candle.pha.pa.us
Whole thread Raw
In response to INT2OID, etc.  (darcy@druid.net (D'Arcy J.M. Cain))
Responses Re: [HACKERS] INT2OID, etc.  (darcy@druid.net (D'Arcy J.M. Cain))
List pgsql-hackers
>
> 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.

I will say that pg_dump does use it, but it is not really a 3rd party
library.

I recommend you use the file, and make them supply the pgsql source
directory as part of the compile, that way, you can access the files you
need directly.  You can do a lookup in pg_type for the names of the
types you want.  Maybe you can even write a little psql script to
extract the oid's you need from pg_type, convert the output to #defines,
and #include that in your compile.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: "Billy G. Allie"
Date:
Subject: Re: [HACKERS] Platforms with v6.3 trouble
Next
From: "Vadim B. Mikheev"
Date:
Subject: Re: [HACKERS] INT2OID, etc.