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 1lqelM-0001dm-Em for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Jun 2021 16:39:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqelL-000142-Ei for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Jun 2021 16:39:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqelL-00013u-8U for pgsql-bugs@lists.postgresql.org; Tue, 08 Jun 2021 16:39:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqelJ-0002Rf-Av for pgsql-bugs@lists.postgresql.org; Tue, 08 Jun 2021 16:39:34 +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 158GdVmt1119505; Tue, 8 Jun 2021 12:39:31 -0400 From: Tom Lane To: arthur.mcgibbon@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17052: Incorrect params inferred on PREPARE (part 2) In-reply-to: <17052-0bb053c08bb80fb6@postgresql.org> References: <17052-0bb053c08bb80fb6@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 08 Jun 2021 11:27:51 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1119503.1623170371.1@sss.pgh.pa.us> Date: Tue, 08 Jun 2021 12:39:31 -0400 Message-ID: <1119504.1623170371@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > SET timestampCol = $1 + interval '1 minute'; > ...results in an error... > ERROR: column "timestampcol" is of type timestamp without time zone but > expression is of type interval > LINE 4: set timestampCol = $1 + interval '1 minute'; > ^ As in your other report, the context in which the parameter type is guessed is just the immediate context of the plus-operator expression. The relevant rule there is "guess that an unknown input is of the same type as the other input", so we resolve the operator as interval + interval. regards, tom lane