Re: constants for return value from PQftype?

From: Adam Haberlach <adam(at)newsnipple(dot)com>
To: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: constants for return value from PQftype?
Date: 2002-01-08 17:36:59
Message-ID: 20020108093659.B8203@newsnipple.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 08, 2002 at 02:47:16PM +0000, Thomas Lockhart wrote:
> > I'm trying to build the PoPy PostgreSQL/Python interface so that
> > I can use PostgreSQL with Zope, and I'm having some problems:
> ...
> > ././PoPy.c: In function `PoPy_converter':
> > ././PoPy.c:77: `BOOLOID' undeclared (first use in this function)
> ...
> > I looked through the headers and the documentation. the PG_xxx constants
> > don't seem to be in the the user include files. I can't seem to find PQftype in
> > the documentation, or any hint as to what it should be returning. Shouldn't
> > these constants, or something like them be somewhere in the include files?
>
> These values are not *guaranteed* to be constants across PostgreSQL
> releases (though in fact they tend to stay the same). It is possible to
> query the database to find them on connection startup (then populate a
> Python dictionary with them for lookup?), or you can hardcode them in as
> your current code does. As you noted the definitions are not considered
> part of client-side code so were removed from the include files.

Yeah, I understand the bit about them not being constant from release
to release. I was just wondering if the only way to actually use PQftype was
to query the database. I know that the python api in the contrib dictionary
does this. Can we get a note in the documentation regarding the PQftype that
it returns an Oid that corresponds to some field in some table somewhere in
the system catalog, and that it doesn't necessarily return a commonly
defined constant?

I'll use the 'make install-all-headers' that was mentioned.

> Are you building PostgreSQL from sources? If so, the definitions are
> available in the backend catalog header files...

I knew this and did some hacking to try and get that to work, but the
going was hard enough that I figured it was officially discouraged, and
hoped there was a better way.

--
Adam Haberlach | Who buys an eight-processor machine and then
adam(at)newsnipple(dot)com | watches 30 movies on it all at the same time?
http://newsnipple.com | Beats me. They told us they could sell it, so
| we made it. -- George Hoffman, Be Engineer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeppe S 2002-01-08 18:02:04 PostgreSQL Replication and more
Previous Message Adam Haberlach 2002-01-08 17:33:09 Re: sequential scans and the like operator