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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Eduardo Pérez Ureta <edpeur(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14853: Parameter type is required even when the query does not need to know the type
Date: 2017-10-15 18:23:47
Message-ID: CAKFQuwZU0OBrJCVfChuXkShi+L_-9psDDUYGXvrnYbbD-Odxug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sunday, October 15, 2017, Eduardo Pérez Ureta <edpeur(at)gmail(dot)com> wrote:

> I understand that not sending the type for a parameter (when it is not
> null) may not make much sense.
> But, currently PostgreSQL accepts parameters with unknown types in
> statements like:
> INSERT INTO t1 (col1) VALUES (?)
> SELECT * FROM t1 WHERE col1 = ?
> where the column can be different types like VARCHAR or TIMESTAMP
>

col1 has a type and so the type of the unspecified variable can be
inferred. Your is null example cannot have its typed inferred.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Dolgov 2017-10-15 19:41:53 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Previous Message Eduardo Pérez Ureta 2017-10-15 17:23:13 Re: BUG #14853: Parameter type is required even when the query does not need to know the type