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: 7633.1041756357@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Browse pgsql-hackers by date

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