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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Дата
Msg-id CAKFQuwY2ce_MPA1NfURTy_O-XY6whj9eODPu6FA5r_k0q9dSKw@mail.gmail.com
обсуждение исходный текст
Ответ на 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>)
Ответы Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Список pgsql-bugs
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 по дате отправления:

Предыдущее
От: Eduardo Pérez Ureta
Дата:
Сообщение: Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: [BUGS] Improper const-evaluation of HAVING with grouping sets and subquery pullup