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

Поиск
Список
Период
Сортировка
От Eduardo Pérez Ureta
Тема Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Дата
Msg-id CAM7oS3FkCsSRM_W4xhuujuV8tv=VLVPCPA3z3UNzV0WY2uaP8g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Список pgsql-bugs
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.

On Oct 16, 2017 5:39 PM, "David G. Johnston" <david.g.johnston@gmail.com> wrote:
On Mon, Oct 16, 2017 at 8:24 AM, Eduardo Pérez Ureta <edpeur@gmail.com> wrote:
I have an application that I am trying to make it work in PostgreSQL and PostgreSQL seems to be the only database that does not support queries like:
SELECT 1 WHERE ? IS NULL
with a Java setTimestamp parameter.

You say PostgreSQL is strongly typed, but an unknown type is accepted in the cases I presented before. Do you mean that PostgreSQL is not following the SQL standard?


​When PostgreSQL is done parsing a statement every externally visible element of that statement needs to have a type.  For prepared statements that means output columns and input parameters. Data types for both either need to be explicitly stated or inferred from the context of the query as parsed.

I cannot speak to the SQL standard or other databases.  I'm also not well-versed in the implementation details here - just the observed behavior.  I do suspect some possibility for improvement here but someone would have to expend considerable time and effort and the lack of comments from hackers does not bode well for that at this moment (i.e., I don't think your recommended change works but I'm not experienced enough to say for certain).  You are welcome to compile your own fork with that change incorporated and run both the PostgreSQL test suite and your application's test suite.  Favorable results there might result in provoking interest from others.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Следующее
От: Eduardo Pérez Ureta
Дата:
Сообщение: Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type