public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Giovani Garcia <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Doubt regarding query parameter metadata
Date: Thu, 01 Apr 2021 10:14:20 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <eCpNID63M_eEUgOvB_39vy2LH_FaR9YS3hoUp7fYHbsKOQp9OzOfGglSQV3Cs50ajXJK3DBpZ-fma6qCawNyfX2Py3jnP7IOhr4FTUcbGBk=@protonmail.com>
References: <eCpNID63M_eEUgOvB_39vy2LH_FaR9YS3hoUp7fYHbsKOQp9OzOfGglSQV3Cs50ajXJK3DBpZ-fma6qCawNyfX2Py3jnP7IOhr4FTUcbGBk=@protonmail.com>

Giovani Garcia <[email protected]> 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 = $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





view thread (4+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Doubt regarding query parameter metadata
  In-Reply-To: <[email protected]>

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

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