Re: Minor ON CONFLICT related fixes

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor ON CONFLICT related fixes
Date: 2015-05-18 21:09:45
Message-ID: CAM3SWZSY2BqOy2B0ukahU7J38iQJEK7DDnEmG3SEZcbcXwR4ZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 16, 2015 at 11:48 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> FYI, I found an unrelated bug within ruleutils.c (looks like the
> targetlist kludge in set_deparse_planstate() isn't sufficiently
> general):
>
> postgres=# explain insert into upsert as u values('Bat', 'Bar') on
> conflict (key) do update set val = excluded.val where exists (select 1
> from upsert ii where ii.key = excluded.key);
> ERROR: XX000: bogus varno: 65000
> LOCATION: get_variable, ruleutils.c:5916

You pointed out that the reason for this trivial bug on Jabber, but
here's the obvious fix, including an EXPLAIN regression test.

--
Peter Geoghegan

Attachment Content-Type Size
0003-Fix-initialization-of-ON-CONFLICT-WHERE-quals.patch text/x-patch 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilya I. Ashchepkov 2015-05-18 21:21:18 Re: jsonb concatenate operator's semantics seem questionable
Previous Message David G. Johnston 2015-05-18 20:54:33 Re: jsonb concatenate operator's semantics seem questionable