Re: pgsql oid question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql oid question
Дата
Msg-id 7633.1041756357@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql oid question  ("Reggie Burnett" <rykr@bellsouth.net>)
Список pgsql-hackers
"Reggie Burnett" <rykr@bellsouth.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Reggie Burnett"
Дата:
Сообщение: Re: pgsql oid question
Следующее
От: Peter Mount
Дата:
Сообщение: Re: New Portal in Place, DNS switched ...