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: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(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:43:03
Message-ID: CAM7oS3HWzvpeB5m4_1Lxy-8AFFs7AXXxyXimc=aG+tN+BBYjnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Oct 16, 2017 6:33 PM, "Tomas Vondra" <tomas(dot)vondra(at)2ndquadrant(dot)com>
wrote:

> Hi,
>
> On 10/16/2017 05:24 PM, Eduardo Pérez Ureta 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.
> >
>
> So you're passing a timestamp value to PostgreSQL only to find out if
> it's NULL? I don't want to be rude, but that seems a bit ... strange.
>

Yes, it is a bit strange, but I am trying to not modify a working
application.

>
> > You say PostgreSQL is strongly typed, but an unknown type is accepted
> > in the cases I presented before.
> >
>
> As David already pointed out before, these examples are not equal. In
> the other cases PostgreSQL can easily infer the data type from other
> parts of the query (e.g. target column in an INSERT). But that's not the
> case here.
>

I still do not see why PostgreSQL cannot infer that the type is not
required.

>
> > Do you mean that PostgreSQL is not following the SQL standard?
> >
>
> Can you kindly point us to the part where SQL Standard requires the
> behavior you're requesting?
>

I do not have access to the SQL standard. I was just asking.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2017-10-16 18:09:21 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:43 Re: BUG #14853: Parameter type is required even when the query does not need to know the type