Re: BUG #14853: Parameter type is required even when the query does not need to know the type

From: Eduardo Pérez Ureta <edpeur(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: BUG #14853: Parameter type is required even when the query does not need to know the type
Date: 2017-10-16 17:39:43
Message-ID: CAM7oS3H3hXBTjpRB+9Je=wB12RFiDczyCyJU5kugTdi3qigw5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I do not see why PostgreSQL cannot infer that no type is needed.

Maybe pgjdbc is the one that needs fixing but the lack of strong typing
makes it difficult to make an acceptable patch.
See: https://github.com/pgjdbc/pgjdbc/pull/969

On Oct 16, 2017 5:49 PM, "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> wrote:

>
>
> 2017-10-16 17:24 GMT+02:00 Eduardo Pérez Ureta <edpeur(at)gmail(dot)com>:
>
>> 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?
>>
>
> this case is one, where datatype cannot be detected from context, and
> Postgres requires it.
>
> There is another question if there is not some issue on Java maybe JDBC
> side.
>
> Regards
>
> Pavel
>
>
>> On Oct 16, 2017 4:03 PM, "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
>> wrote:
>>
>>> On Sun, Oct 15, 2017 at 10:40 PM, Eduardo Pérez Ureta <edpeur(at)gmail(dot)com>
>>> wrote:
>>>
>>>> My example is even better!
>>>> There is no need to infer the type as it is not needed!
>>>> PostgreSQL should be able to infer that no type is needed.
>>>>
>>>
>>> ​It could - but since SQL is a strongly typed language it doesn't have
>>> that luxury.
>>>
>>> The original thread you pointed to complained about the regression from
>>> protocol v2 to protocol v3. Is that your complaint too or do you have some
>>> other use case?
>>>
>>> David J.
>>>
>>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Eduardo Pérez Ureta 2017-10-16 17:43:03 Re: BUG #14853: Parameter type is required even when the query does not need to know the type
Previous Message Eduardo Pérez Ureta 2017-10-16 17:39:31 Re: BUG #14853: Parameter type is required even when the query does not need to know the type