pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Dominique Devienne <ddevienne@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: [libpq] OIDs of extension types? Of custom types?
Date: Fri, 14 Oct 2022 14:30:59 +0200
Message-ID: <e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at> (raw)
In-Reply-To: <CAFCRh-85tjcuHViBFtn8p53-URXrgJRqs3XdKx6igHqbZed0Gg@mail.gmail.com>
References: <CAFCRh-85tjcuHViBFtn8p53-URXrgJRqs3XdKx6igHqbZed0Gg@mail.gmail.com>

On Fri, 2022-10-14 at 13:39 +0200, Dominique Devienne wrote:
> Hi. I'm using binary binds and results for DMLs, as well as for COPY.
> 
> So far, I've stayed within built-in scalar and array types, thus I
> could hardcode the OIDs of values "in the type-system" (in C++, via
> traits).
> But I'd like to venture into extension (e.g. hstore) and custom
> (enums, domain, etc...) types.
> Thus I'm wondering:
> 1) whether "official" extensions have fixed/stable OIDs, like in my
> hstore example. If so, where are they defined?
> 2) how should I be looking up OIDs for custom (or extension?) types
> with libpq? Any specific APIs? Or I need to do SQL instead?
> 3) If I duplicate custom types per-schema, to keep them standalone,
> they'll get different OIDs, right?

You use the #defines like TEXTOID for the built-in Oids, right?

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

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (5+ messages)  latest in thread

Message-ID: <e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at>
Permalink:  ../e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at/
Also on:    postgresql.org/message-id/e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, ddevienne@gmail.com
  Subject: Re: [libpq] OIDs of extension types? Of custom types?
  In-Reply-To: <e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at>
  References: <CAFCRh-85tjcuHViBFtn8p53-URXrgJRqs3XdKx6igHqbZed0Gg@mail.gmail.com> <e413a7ce097b9f3beb015e42dfcb6f0d9d8eccea.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox