pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: christopher.m.hanks@gmail.com, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14220: pg_get_expr() with an incorrect relation id crashes the server
Date: Fri, 01 Jul 2016 10:32:33 -0400
Message-ID: <18868.1467383553@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqRhsKK8BP1yo=s4ZKH42gzSwTfDWHVT2C_PbK6cqzTkJg@mail.gmail.com>
References: <20160629224349.1407.32667@wrigleys.postgresql.org>
	<CAEepm=1P-5cm858uxvXG7sPiO5Z7DUCy-iwujCLYerfC30WCZg@mail.gmail.com>
	<CAB7nPqRhsKK8BP1yo=s4ZKH42gzSwTfDWHVT2C_PbK6cqzTkJg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Michael Paquier <michael.paquier@gmail.com> writes:
> I have poked at this bug report yesterday and today, and found that it
> is as well possible to hit the second assertion two lines below with a
> dropped column. So I would like to propose the patch attached to
> replace both assertions with an elog(ERROR).

There's a quite similar error check just a few lines above that prints

        elog(ERROR, "bogus varattno for subquery var: %d", var->varattno);

I'm not necessarily wedded to that exact phrasing, but I think these new
error messages should be consistent with that one.  I'm a bit inclined
to make all three of them read like

        elog(ERROR, "invalid attnum %d for table \"%s\"",
             attnum, rte->eref->aliasname);

> Test cases are included,
> though I am not sure if they bring much value.

Yeah, I can't get very excited about memorializing those.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)

Message-ID: <18868.1467383553@sss.pgh.pa.us>
Permalink:  ../18868.1467383553@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18868.1467383553@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com, thomas.munro@enterprisedb.com
  Subject: Re: BUG #14220: pg_get_expr() with an incorrect relation id crashes the server
  In-Reply-To: <18868.1467383553@sss.pgh.pa.us>
  References: <20160629224349.1407.32667@wrigleys.postgresql.org> <CAEepm=1P-5cm858uxvXG7sPiO5Z7DUCy-iwujCLYerfC30WCZg@mail.gmail.com> <CAB7nPqRhsKK8BP1yo=s4ZKH42gzSwTfDWHVT2C_PbK6cqzTkJg@mail.gmail.com> <18868.1467383553@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox