Re: Update count mismatch - internal error

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: Update count mismatch - internal error
Date: 2015-09-20 01:17:33
Message-ID: CAM3SWZTj5jAQigMgHpTakdenG_tSAEpU3V5FTcpxJr_NHpwjaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 19, 2015 at 5:15 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> postgres[14993][1]=# CREATE TABLE mismatch(a int, b int);
> CREATE TABLE
> postgres[14993][1]=# UPDATE mismatch SET a = mismatch.*;
> ERROR: XX000: UPDATE target count mismatch --- internal error
> LOCATION: transformUpdateTargetList, analyze.c:2103
>
> Seems to be a longer standing thing, going at least back to 9.0.

I noticed this myself.

Arguably, the only problem is that this is reported as an internal
"can't happen" error. We're already tightening up the use of
elog(ERROR, ...) to be strictly limited to cases that are actually
"can't happen" (assuming there are no bugs and no data corruption). We
should do the same here.

I doubt it's worth preserving this message for the benefit of
theoretical buggy code paths that raise it for some other reason.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-09-20 01:40:14 Re: ON CONFLICT issues around whole row vars,
Previous Message Andres Freund 2015-09-20 00:15:11 Update count mismatch - internal error