Skip site navigation (1) Skip section navigation (2)

Re: pgsql oid question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Reggie Burnett" <rykr(at)bellsouth(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgsql oid question
Date: 2003-01-05 08:45:57
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Reggie Burnett" <rykr(at)bellsouth(dot)net> writes:
> Ok, that adds some clarity.  Have base types (int32, etc) had the same
> oid values for a significant number of versions of PgSQL?  What I am
> getting at is this:  can I hard code oid values into an access layer for
> PgSQL?

AFAIK, we have never renumbered an existing standard type.  But we
reserve the right to do it.  Also, base types have appeared and
disappeared in living memory (eg, datetime).

Minimum prudence would be to #include pg_type.h and then write INT4OID
rather than 23 (for example).  A more paranoid approach is to establish
a typename<->oid cache on the client side and not believe anything you
haven't probed during the current connection.  The Java driver takes the
paranoid approach, but some other clients such as the ODBC driver rely
on #defines.  The tradeoffs are pretty obvious, so make your own choice
about what to do.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Peter MountDate: 2003-01-05 12:27:47
Subject: Re: New Portal in Place, DNS switched ...
Previous:From: Reggie BurnettDate: 2003-01-05 07:39:11
Subject: Re: pgsql oid question

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group