[postgresql 10 beta3] unrecognized node type: 90

Adam, Etienne (Nokia-TECH/Issy Les Moulineaux) <etienne.adam@nokia.com>

From: "Adam, Etienne (Nokia-TECH/Issy Les Moulineaux)" <etienne.adam@nokia.com>
To: pgsql-bugs@postgresql.org
Cc: "Duquesne, Pierre (Nokia-TECH/Issy Les Moulineaux)" <pierre.duquesne@nokia.com>
Date: 2017-08-11T15:33:22Z
Lists: pgsql-bugs, pgsql-hackers
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

Commits

  1. Separate reinitialization of shared parallel-scan state from ExecReScan.

  2. Restore test case from a2b70c89ca1a5fcf6181d3c777d82e7b83d2de1b.

  3. Force rescanning of parallel-aware scan nodes below a Gather[Merge].

  4. Fix ExecReScanGatherMerge.

  5. Add missing call to ExecReScanGatherMerge.