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 1lSJwd-0006QQ-BZ for pgsql-interfaces@arkaria.postgresql.org; Fri, 02 Apr 2021 13:34:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lSJwc-0005Df-9R for pgsql-interfaces@arkaria.postgresql.org; Fri, 02 Apr 2021 13:34:38 +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 1lRzGz-0006vf-HU for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 15:30:17 +0000 Received: from mail-40138.protonmail.ch ([185.70.40.138]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRzGw-0006z3-GW for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 15:30:17 +0000 Date: Thu, 01 Apr 2021 15:30:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1617291010; bh=40FcgSaoGiBQQEuwEpF8nZyB80tXE9jZ98q8s8UYRXk=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=k/SlV5bjBH3ZrU0M+ZUqbg0VskiFbRJ2THGW0kvYaZed35jj5vAM1KzJQ+BtwYmpe f9kEvkk/4NAZb7OnXuhhOtBw9isUgjUSnzTaW9cXI6qgnR6jTapOfQITNyoBiDZtiX euqGXFuWGPssslGE5nJ1aIMyjKTgqMjFSnWPMdwk= To: Tom Lane From: Giovani Garcia Cc: "pgsql-interfaces@lists.postgresql.org" Reply-To: Giovani Garcia Subject: Re: Doubt regarding query parameter metadata Message-ID: In-Reply-To: <3396840.1617286460@sss.pgh.pa.us> References: <3396840.1617286460@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Tom, Thanks for taking the time. > Is that theexact query you're issuing? Yes, that's the exact query. You can reproduce the issue by creating the table and running the C program= from my previous e-mail. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Thursday, 1 April 2021 11:14, Tom Lane wrote: > Giovani Garcia giovani.garcia@protonmail.com writes: > > > The issue I'm finding is that the Oid returned for a VARCHAR column is = TEXTOID (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 theexact 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