[BUGS] BUG #14853: Parameter type is required even when the query does notneed to know the type - Mailing list pgsql-bugs

From edpeur@gmail.com
Subject [BUGS] BUG #14853: Parameter type is required even when the query does notneed to know the type
Date
Msg-id 20171013140350.8210.40918@wrigleys.postgresql.org
Whole thread Raw
Responses Re: [BUGS] BUG #14853: Parameter type is required even when the querydoes not need to know the type
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14853
Logged by:          Eduardo Perez
Email address:      edpeur@gmail.com
PostgreSQL version: Unsupported/Unknown
Operating system:   All
Description:

The query:
SELECT ? IS NULL
should work even when the parameter type is unknown, as there is no need to
know the type in that query.

For reference:
http://www.postgresql-archive.org/Regression-Problems-with-Timestamp-arguments-td5770255.html

This patch fixes the issue:
--- postgres/src/backend/tcop/postgres.c
+++ postgres/src/backend/tcop/postgres.c
@@ -1361,20 +1361,6 @@                                        ¶mTypes,
&numParams);
-        /*
-         * Check all parameter types got determined.
-         */
-        for (i = 0; i < numParams; i++)
-        {
-            Oid            ptype = paramTypes[i];
-
-            if (ptype == InvalidOid || ptype == UNKNOWNOID)
-                ereport(ERROR,
-                        (errcode(ERRCODE_INDETERMINATE_DATATYPE),
-                         errmsg("could not determine data type of parameter $%d",
-                                i + 1)));
-        }
-        if (log_parser_stats)            ShowUsage("PARSE ANALYSIS STATISTICS");


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: [BUGS] BUG #14849: jsonb_build_object doesn't like VARIADIC callsvery much
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: [BUGS] BUG #14851: Systemd kills long-running recovery