Hi,
While testing the beta3 of PostgreSQL 10 (Ubuntu/10~beta3-1.pgdg16.04+1) on a database restored from production data, executing the following query (field and table names have been changed):
SELECT id_c
FROM c
LEFT OUTER JOIN (
SELECT h_c AS h_c_sub, count(*) AS num
FROM r, c
WHERE id_a_r = 1308 AND id_c = id_c_r
GROUP BY h_c
) AS sent ON h_c = h_c_sub
WHERE ((date_trunc('days', age('2017-08-10', to_timestamp(d1_c))) > '11 days') AND ((h->'x') IS NULL) AND ((h->'x') IS NULL) AND ((d2_c IS NOT NULL AND date_trunc('days', age('2017-08-10', to_timestamp(d2_c))) <= '10 days')))
AND NOT bool1 AND string1 IS NOT NULL AND (bool2 IS NULL OR bool2 = true) AND coalesce(num, 0) < 1 AND coalesce(bool3, TRUE) IS TRUE;
We encountered the following error (the query executes fine on a 9.2 server):
ERROR: XX000: unrecognized node type: 90
LOCATION: ExecReScan, execAmi.c:284
If we modify it just a little bit (removing a WHERE clause), it works:
SELECT id_c
FROM c
LEFT OUTER JOIN (
SELECT h_c AS h_c_sub, count(*) AS num
FROM r, c
WHERE id_a_r = 1308 AND id_c = id_c_r
GROUP BY h_c
) AS sent ON h_c = h_c_sub
WHERE ((date_trunc('days', age('2017-08-10', to_timestamp(d1_c))) > '11 days') AND ((h->'x') IS NULL) AND ((h->'x') IS NULL))
AND NOT bool1 AND string1 IS NOT NULL AND (bool2 IS NULL OR bool2 = true) AND coalesce(num, 0) < 1 AND coalesce(bool3, TRUE) IS TRUE;
We know it is a beta version but we wanted to report it in case it was not a known bug. Please let us know if you need anything more,
Best,
Adam Etienne