Re: Getting ERROR: bogus varno: 2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Getting ERROR: bogus varno: 2
Дата
Msg-id 10562.1552413439@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Getting ERROR: bogus varno: 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I wrote:
> Neel Patel <neel.patel@enterprisedb.com> writes:
>> Is this error message expected or what should be the behaviour ?

> It's certainly a bug.

Oh, no, I take that back: it's not a bug, you're just abusing
pg_get_expr() to try to do something it can't do, which is make
sense of an expression involving more than one relation.
(OLD and NEW are different relations in a trigger WHEN clause.)

You can use pg_get_triggerdef() to decompile a trigger WHEN clause,
although that might do more than you want.

Not sure if there's any value in trying to make the failure
message more user-friendly.  You can get weird errors by
misusing pg_get_expr() in other ways too, such as giving it
the wrong relation OID.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Getting ERROR: bogus varno: 2
Следующее
От: Paul Ramsey
Дата:
Сообщение: Re: Compressed TOAST Slicing