Re: Doubt regarding query parameter metadata

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Giovani Garcia <giovani(dot)garcia(at)protonmail(dot)com>
Cc: "pgsql-interfaces(at)lists(dot)postgresql(dot)org" <pgsql-interfaces(at)lists(dot)postgresql(dot)org>
Subject: Re: Doubt regarding query parameter metadata
Date: 2021-04-01 18:07:00
Message-ID: 3457548.1617300420@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Giovani Garcia <giovani(dot)garcia(at)protonmail(dot)com> writes:
>> Is that theexact query you're issuing?

> Yes, that's the exact query.

Oh ... after actually trying the program you sent, I realized you are
looking at the wrong thing, or at least asking about something other
than what I thought you were asking about. You are querying
PQparamtype(), that is, the type of the symbol $1, not the type of
the returned column "key" which is what I thought you meant. As I
explained before, varchar has no operators, particularly not equality;
so "value = $1" is interpreted using the text = text operator, making
it effectively "value::text = $1::text". Thus $1 is resolved as type
text.

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Greg Sabino Mullane 2021-05-21 21:36:35 DBD::Pg version 3.15.0 released
Previous Message Giovani Garcia 2021-04-01 15:30:05 Re: Doubt regarding query parameter metadata