Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojJqG-0005oq-SG for pgsql-general@arkaria.postgresql.org; Fri, 14 Oct 2022 12:31:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ojJqF-0001dy-P6 for pgsql-general@arkaria.postgresql.org; Fri, 14 Oct 2022 12:31:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojJqF-0001dh-F0 for pgsql-general@lists.postgresql.org; Fri, 14 Oct 2022 12:31:07 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ojJqA-0004rC-2O for pgsql-general@postgresql.org; Fri, 14 Oct 2022 12:31:06 +0000 Received: by mail-ej1-x631.google.com with SMTP id ot12so10203545ejb.1 for ; Fri, 14 Oct 2022 05:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=DZJKvpbGs9CeBmcDUFTx0PofULMHDwUGQszyuTmme0Q=; b=CP6PcsrykN3SUtT1+No/1ZPH4koWJv2LR8eQCfEWSwJMaY6DAStYES1evyruY4BcgT 3GJ337EvcU0ymTo0y9qw0ofEq9fuWTTvKfhXXDPbesOqnozIx61EPyPX2RwZcD3QRF2v /jeT+DSozLTyTUqNtKrQrfJlGBqRU1V8Id37IkX1coY4IlTGhmXtqQLV/xwixK2aRLy3 Bdl0ZpxbvcIkcR+wIDNaQkmZxUnOY15H/hByIrg+gMQeeeXBgXIK5e1/jYC1QCYUstRJ keaftBO2ZDPKAQhV3n/Nzln3Dpp6Cw3vfz19q8/Usjc9EBEn0q5geHFauzvVSkIl7/sM x1Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DZJKvpbGs9CeBmcDUFTx0PofULMHDwUGQszyuTmme0Q=; b=SusxBSzFEn7iTl+KEaLBgC9e+NlvJ7niC2KZrzWw7eTFmHSm2NvZVMi3HroTVuUDoO kVHUjYNhzAHSVPXpGbRP9KQUgLcOyc877lVU8aqgF7k5R3fkLvC/WD/LkGcaeUbjGB6D KLQCpDSsSTYZfVbkar9ZUuJ5W2ROK+Uka98a+3OdV25ikJmp6zKrPW4Kz9mahqwqH19o mWezJP5S5edE+tZ+1dziaSVf5O3TNldCNglnQ3RVkGdQ2MN48hTeMpG4OCBCPYWW9uGJ IWZZdR+WFRxFKM+oLyi/MNVBOnK7U8ODH29ieI1HAObzKDD1PSAQERB9YUnlCWm3mvt9 W1Tg== X-Gm-Message-State: ACrzQf3fP+kv57O6ZvcvC5qwen4xcAsgzRDglhTpn7llJY6yoP01iStN /GfyMUDqwUVQO3iOz3j1cr3ZCE3jon3NPg== X-Google-Smtp-Source: AMsMyM50oMfsfjGyfIVzdD3vKHsK2n0Qb8j0KyLmiMg1wPnv8EajOAvmiHoMgX/N50j1oTo7ZIwgLA== X-Received: by 2002:a17:907:60c8:b0:78d:bc8d:8457 with SMTP id hv8-20020a17090760c800b0078dbc8d8457mr3302161ejc.418.1665750660786; Fri, 14 Oct 2022 05:31:00 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:cddf:dd82:2817:4f1:8514]) by smtp.gmail.com with ESMTPSA id g2-20020a170906594200b0074182109623sm1503862ejr.39.2022.10.14.05.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 05:31:00 -0700 (PDT) Message-ID: Subject: Re: [libpq] OIDs of extension types? Of custom types? From: Laurenz Albe To: Dominique Devienne , pgsql-general@postgresql.org Date: Fri, 14 Oct 2022 14:30:59 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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