pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: arthur.mcgibbon@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17052: Incorrect params inferred on PREPARE (part 2)
Date: Tue, 08 Jun 2021 12:39:31 -0400
Message-ID: <1119504.1623170371@sss.pgh.pa.us> (raw)
In-Reply-To: <17052-0bb053c08bb80fb6@postgresql.org>
References: <17052-0bb053c08bb80fb6@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> 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





view thread (3+ messages)

Message-ID: <1119504.1623170371@sss.pgh.pa.us>
Permalink:  ../1119504.1623170371@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1119504.1623170371@sss.pgh.pa.us

 · 

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: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, arthur.mcgibbon@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17052: Incorrect params inferred on PREPARE (part 2)
  In-Reply-To: <1119504.1623170371@sss.pgh.pa.us>

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

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