Re: [libpq] OIDs of extension types? Of custom types? - Mailing list pgsql-general

From Dominique Devienne
Subject Re: [libpq] OIDs of extension types? Of custom types?
Date
Msg-id CAFCRh-_k_kFRw6FWnmQdo4NEk9ufOaC+80ithjYESXk16ZMhKg@mail.gmail.com
Whole thread Raw
In response to Re: [libpq] OIDs of extension types? Of custom types?  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: [libpq] OIDs of extension types? Of custom types?
List 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 by date:

Previous
From: Christoph Moench-Tegeder
Date:
Subject: Re: does postgres has snapshot standby feature?
Next
From: Tom Lane
Date:
Subject: Re: [libpq] OIDs of extension types? Of custom types?