Re: sqlsmith: ERROR: XX000: bogus varno: 2

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: sqlsmith: ERROR: XX000: bogus varno: 2
Date: 2021-12-20 14:49:09
Message-ID: CA+TgmobHkyGKM_DOgzGbh7BiWXdBGLMTnmB2S_FyyNHgqTxqBg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 19, 2021 at 4:17 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> > I reduced the problematic query to this.
> > SELECT 1 FROM pg_rewrite WHERE
> > pg_get_function_arg_default(ev_class, 1) !~~
> > pg_get_expr(ev_qual, ev_class, false);
>
> Or more simply,
>
> regression=# select pg_get_expr(ev_qual, ev_class, false) from pg_rewrite where rulename = 'pg_settings_u';
> ERROR: bogus varno: 2
>
> I don't see anything particularly surprising here. pg_get_expr is only
> able to cope with expression trees over a single relation, but ON UPDATE
> rules can refer to both OLD and NEW relations. Maybe we could make the
> error message more friendly, but there's not much else to be done,
> I think.

+1 for making the error message more friendly.

(We would certainly have a difficult time making it less friendly.)

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2021-12-20 14:57:32 Re: Confused comment about drop replica identity index
Previous Message Robert Haas 2021-12-20 14:44:32 Re: psql format output