Bug?

Started by Paulalmost 25 years ago3 messagesbugs
Jump to latest
#1Paul
magamos@mail.ru

Sequence:
-------------------------------------------------------------
listen xxx;
create table xx (a int4);
create rule xx_xx2 as on delete to xx where old.a=1 do notify xxx;
-------------------------------------------------------------

Output:
something like "backend closed connection"

Output I expected:
at least some error message, but not closing of connection.
I know that my SQL sequence is wrong, but i just expected the error
message.

PostgreSQL version:
7.1.1

Platform information:
Linux Slackware 7.1, kernel 2.4.1

--
Best regards,
Paul mailto:magamos@mail.ru

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Paul (#1)
Re: Bug?

Paul <magamos@mail.ru> writes:

create rule xx_xx2 as on delete to xx where old.a=1 do notify xxx;

I see it too. Will investigate.

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Paul (#1)
Re: Bug?

Paul <magamos@mail.ru> writes:

create table xx (a int4);
create rule xx_xx2 as on delete to xx where old.a=1 do notify xxx;
something like "backend closed connection"

Okay, the problem here is that we don't support NOTIFY (or other utility
statements) in conditional rules. This isn't likely to change soon.
I agree it shouldn't crash though; will fix that.

Consider using a trigger to do the notify, instead.

regards, tom lane