Re: [BUGS] BUG #14153: Unrecognized node type error when upsert is present in recursive CTE

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Thomas Alton <thomas(dot)alton(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #14153: Unrecognized node type error when upsert is present in recursive CTE
Date: 2016-05-23 19:02:41
Message-ID: CAM3SWZTuzNykt0gz=mdG9e5hVXvBC-JocKfEuEbU7SvRKH8B6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sat, May 21, 2016 at 5:03 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> On Sat, May 21, 2016 at 4:28 PM, <thomas(dot)alton(at)gmail(dot)com> wrote:
>> ERROR: XX000: unrecognized node type: 920
>> LOCATION: raw_expression_tree_walker, nodeFuncs.c:3410
>>
>> I expected the query run successfully and return one row with 'a'.
>
> This is clearly a bug.
>
> 920 is IndexElem, which can appear in a raw parse tree in 9.5, due to
> ON CONFLICT's use of inference reusing what was previously only used
> for CREATE INDEX. (It does not make it into the post-parse analysis
> tree, though).

Attached patch fixes this issue by adding the appropriate
raw_expression_tree_walker handler. This isn't the first quasi-utility
node to need such a handler, so the fix is simple.

--
Peter Geoghegan

Attachment Content-Type Size
0001-Add-IndexElem-to-raw_expression_tree_walker.patch text/x-patch 1.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-05-23 19:07:21 Re: BUG #14147: Restore of MatView of Foreign Data Table fails
Previous Message Charles 2016-05-23 17:05:41 Re: BUG #14138: Inconsistent rounding behavior in float4 coercion

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2016-05-23 19:13:44 Re: Changed SRF in targetlist handling
Previous Message David G. Johnston 2016-05-23 18:30:13 Re: Changed SRF in targetlist handling