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 1lRy5h-000502-9F for pgsql-interfaces@arkaria.postgresql.org; Thu, 01 Apr 2021 14:14:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRy5f-0003So-2F for pgsql-interfaces@arkaria.postgresql.org; Thu, 01 Apr 2021 14:14:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRy5e-0003Sg-T2 for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 14:14:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRy5c-0002Rx-Nf for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 14:14:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 131EEKgq3396841; Thu, 1 Apr 2021 10:14:21 -0400 From: Tom Lane To: Giovani Garcia cc: "pgsql-interfaces@lists.postgresql.org" Subject: Re: Doubt regarding query parameter metadata In-reply-to: References: Comments: In-reply-to Giovani Garcia message dated "Thu, 01 Apr 2021 03:33:40 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3396839.1617286460.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 01 Apr 2021 10:14:20 -0400 Message-ID: <3396840.1617286460@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Giovani Garcia writes: > The issue I'm finding is that the Oid returned for a VARCHAR column is T= EXTOID (25) instead of VARCHAROID (1043). This isn't hugely surprising in general. varchar has no operations of its own; PG treats it as sort of a domain over text. So if you do anything at all to a varchar column, it'd be quite likely for the column to be implicitly coerced to text within the query. > Now, when I run the following program (simplified for brevity), > "SELECT key FROM oid_test WHERE value =3D $1", Is that the *exact* query you're issuing? I don't see anything in that that would cause a coercion, but maybe you left out some relevant detail. regards, tom lane