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

From: edpeur(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Cc: edpeur(at)gmail(dot)com
Subject: BUG #14853: Parameter type is required even when the query does not need to know the type
Date: 2017-10-13 14:03:50
Message-ID: 20171013140350.8210.40918@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14853
Logged by: Eduardo Perez
Email address: edpeur(at)gmail(dot)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 @@
&paramTypes,
&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");

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2017-10-13 15:23:52 Re: BUG #14851: Systemd kills long-running recovery
Previous Message Dmitry Dolgov 2017-10-13 13:56:45 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much