oversight in EphemeralNamedRelation support

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: hugo(dot)mercier(at)oslandia(dot)com, kgrittn(at)gmail(dot)com, thomas(dot)munro(at)enterprisedb(dot)com
Subject: oversight in EphemeralNamedRelation support
Date: 2017-10-09 13:35:28
Message-ID: CAOBaU_YdPVH+PTtiKSSLOiiW3mVDYsnNUekK+XPbHXiP=wrFLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi,

Hugo Mercier (in Cc) reported me an error in a query, failing since pg10.

Simple test case to reproduce:

CREATE TABLE public.test (id integer);
WITH test AS (select 42) INSERT INTO public.test SELECT * FROM test;

which will fail with "relation "test" cannot be the target of a
modifying statement".

IIUC, that's an oversight in 18ce3a4ab22, where setTargetTable()
doesn't exclude qualified relation when searching for special
relation.

PFA a simple patch to fix this issue, with updated regression test.

Regards.

Attachment Content-Type Size
fix_conflicting_cte.diff text/plain 2.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-10-09 13:47:39 Re: Latches API on windows
Previous Message Alexander Korotkov 2017-10-09 13:27:46 Re: GSoC 2017 : Patch for predicate locking in Gist index