Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
Master
-
7.0.x
-
Committed
-
4
-
Padparadschah 10/25-11/8
Description
Given two tables, one with a date field, the other without one, trying to create a union where the result set of the select with no date returns NULL results in an error.
create table A (id LONG primary key not null, date_ DATE null); create table B (id LONG primary key not null); (select date_ from A) union all (select NULL from B)
Replacing the query above with the following executes successfully:
(select date_ from A) union all (select CAST(NULL AS TIMESTAMP) from B)
To fix the problem we have introduced a new placeholder [$NULL_DATE$] that can be used in queries where Postgres incorrectly infers the type of the field.