Re: Doubt regarding query parameter metadata - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Doubt regarding query parameter metadata
Date
Msg-id 3396840.1617286460@sss.pgh.pa.us
Whole thread Raw
In response to Doubt regarding query parameter metadata  (Giovani Garcia <giovani.garcia@protonmail.com>)
Responses Re: Doubt regarding query parameter metadata  (Giovani Garcia <giovani.garcia@protonmail.com>)
List pgsql-interfaces
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 = $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



pgsql-interfaces by date:

Previous
From: Giovani Garcia
Date:
Subject: Doubt regarding query parameter metadata
Next
From: Giovani Garcia
Date:
Subject: Re: Doubt regarding query parameter metadata