Re: BUG #17052: Incorrect params inferred on PREPARE (part 2)

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "arthur(dot)mcgibbon(at)gmail(dot)com" <arthur(dot)mcgibbon(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17052: Incorrect params inferred on PREPARE (part 2)
Date: 2021-06-08 13:00:41
Message-ID: CAKFQuwZ4sKLEtAzBb9_zbH6bS3s839_m=K-u_A8C4HYrTiF8Wg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tuesday, June 8, 2021, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

>
> I'd hope that PostgreSQL would infer a "timestamp" type here instead of an
> interval type
>
> It seems in this case (and possibly in bug report 17051) Postgres uses only
> a section of the expression to evaluate the parameter type i.e. "$1 +
> interval '1 minute'" and assumes that only an interval type can be added to
> an interval type but there are a number of types that can be added to an
> interval type and ideally it would take into account the result of the
> expression which has to be a timestamp (because of the definition of the
> timestampCol column) and so work out that the only (or best) way to achieve
> that is to have $1 be of type timestamp.
>
>
Maybe, but the failure to do so does not constitute a bug.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-06-08 13:05:08 Re: BUG #17051: Incorrect params inferred on PREPARE
Previous Message PG Bug reporting form 2021-06-08 11:27:51 BUG #17052: Incorrect params inferred on PREPARE (part 2)