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

From David G. Johnston
Subject Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Date
Msg-id CAKFQuwZU0OBrJCVfChuXkShi+L_-9psDDUYGXvrnYbbD-Odxug@mail.gmail.com
Whole thread Raw
In response to 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>)
Responses 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>)
List pgsql-bugs
On Sunday, October 15, 2017, Eduardo Pérez Ureta <edpeur@gmail.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.

pgsql-bugs by date:

Previous
From: Eduardo Pérez Ureta
Date:
Subject: Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
Next
From: Dmitry Dolgov
Date:
Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much