Re: BUG #17051: Incorrect params inferred on PREPARE - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17051: Incorrect params inferred on PREPARE
Date
Msg-id CAKFQuwZXSkAhp0xvVbFFriYzq00G8D6-YRjpX7NLJuci+rsXRg@mail.gmail.com
Whole thread Raw
In response to BUG #17051: Incorrect params inferred on PREPARE  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17051: Incorrect params inferred on PREPARE  (Arthur McGibbon <arthur.mcgibbon@gmail.com>)
List pgsql-bugs
On Tuesday, June 8, 2021, PG Bug reporting form <noreply@postgresql.org> wrote:

I'd hope that PostgreSQL would infer a "timestamp" type here or reply with
an error that it couldn't infer the parameter type.
Why does it default to type "text" and then effectively say the query is
invalid?

Because no one has gotten a patch approved (not sure when/if there was a last attempt for this specific situation) to make the system “smarter”. 

I can cast my parameter in the query to get around this but am submitting
the bug because inferring "text" seems wrong.


Maybe, but the failure to be more intelligent in this area is not itself a bug, and the rules for unknown literal resolution defaulting to text are documented.

David J.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #17052: Incorrect params inferred on PREPARE (part 2)
Next
From: Arthur McGibbon
Date:
Subject: Re: BUG #17051: Incorrect params inferred on PREPARE