Re: [libpq] OIDs of extension types? Of custom types?

Поиск
Список
Период
Сортировка
От Dominique Devienne
Тема Re: [libpq] OIDs of extension types? Of custom types?
Дата
Msg-id CAFCRh-_k_kFRw6FWnmQdo4NEk9ufOaC+80ithjYESXk16ZMhKg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [libpq] OIDs of extension types? Of custom types?  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: [libpq] OIDs of extension types? Of custom types?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, Oct 14, 2022 at 2:31 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> You use the #defines like TEXTOID for the built-in Oids, right?

I don't. I used
https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat
as a reference.
I suspect that should be fairly stable, right? I have at least 2 or 3
dozen OIDs pairs (scalar + array) of primitives
and other types (Oid, Name, Text, Bytea, Uuid, etc...). Are there
#defines for all of those? Where?

template<> struct OidTraits<bool> {
    // boolean, true/false
    static constexpr Type type{ "bool", 1, Oid{ 16 }, Oid{ 1000 } };
};

template<> struct OidTraits<Bytea> {
    // variable-length string, binary values escaped
    static constexpr Type type{ "bytea", -1, Oid{ 17 }, Oid{ 1001 } };
};

etc...

> For types from an extensions, you would run a query on "pg_type".

 OK, thanks.



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

Предыдущее
От: Christoph Moench-Tegeder
Дата:
Сообщение: Re: does postgres has snapshot standby feature?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [libpq] OIDs of extension types? Of custom types?