Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Date
Msg-id CAKFQuwY=HOaXef_pAmSUXJT3oqUcrRVD-GNvgFcUD8OtLyMBdQ@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type  (Eduardo Pérez Ureta <edpeur@gmail.com>)
List pgsql-bugs
On Mon, Oct 16, 2017 at 10:39 AM, Eduardo Pérez Ureta <edpeur@gmail.com> wrote:
I ran the PostgreSQL test suite (make check) and all the tests passed, so, my change should not break anything.
Maybe PostgreSQL should be changed to not require a type in this case.

​I would say that the restriction that I describe is not tested/enforced then.  But even if it was the problem would be that no where else in the test suite would queries with un-typed input parameters be used since they have been disallowed until now.  That is just the nature of programming to a strict constraint and then attempting to loosen it up in the future - there will be no code that actually exercises the loosened constraints.  That's why I suggested running your application test suite - right now it is getting errors; if you change only PostgreSQL does the JDBC driver and your application begin to work correctly with the changed server behavior?

I'd suggest you simply accept that, right now, PostgreSQL refuses allow an outcome of "no type is needed".  You are welcome to spend as much time as you'd like convincing others that doing so is wrong and that not doing so is both useful and safe.  I suppose you've already done that and it is now up to someone more qualified to explain exactly why what you propose will not work.  That someone is not me.

David J.

pgsql-bugs by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14853: Parameter type is required even when the query does not need to know the type