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 1lS1il-0007ZB-QA for pgsql-interfaces@arkaria.postgresql.org; Thu, 01 Apr 2021 18:07:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lS1ik-00058d-JZ for pgsql-interfaces@arkaria.postgresql.org; Thu, 01 Apr 2021 18:07:06 +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 1lS1ik-00058W-Dp for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 18:07:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS1ih-0008HI-U7 for pgsql-interfaces@lists.postgresql.org; Thu, 01 Apr 2021 18:07:06 +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 131I70mc3457549; Thu, 1 Apr 2021 14:07:01 -0400 From: Tom Lane To: Giovani Garcia cc: "pgsql-interfaces@lists.postgresql.org" Subject: Re: Doubt regarding query parameter metadata In-reply-to: References: <3396840.1617286460@sss.pgh.pa.us> Comments: In-reply-to Giovani Garcia message dated "Thu, 01 Apr 2021 15:30:05 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3457547.1617300420.1@sss.pgh.pa.us> Date: Thu, 01 Apr 2021 14:07:00 -0400 Message-ID: <3457548.1617300420@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Giovani Garcia 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