Re: This script will crash the connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <janwieck(at)Yahoo(dot)com>
Cc: Steve Howe <howe(at)carcass(dot)dhs(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: This script will crash the connection
Date: 2001-01-26 18:30:16
Message-ID: 3239.980533816@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <janwieck(at)Yahoo(dot)com> writes:
> Tom Lane wrote:
>> The problem here is that the query rewriter tries to hang the query's
>> qualification (WHERE clause) onto the rule's action query, so that
>> the action query won't be done unless the query finds at least one
>> row to update.
>> NOTIFY commands, being utility statements, don't have qualifications.
>> In 7.0 and before, the qual clause just vanished into the ether, and
>> so in this example the NOTIFY would execute whether the UPDATE updated
>> any rows or not. In 7.1 there is physically noplace to hang the qual
>> (no jointree) and thus a crash.

> Would be something for a STATEMENT trigger. We don't have 'em
> yet and I'm not sure what kind of information they will
> receive if we finally implement them. But the number of rows
> affected by the statement is a good candidate.

That's no help for a 7.1 solution however. We can't start inventing
a new feature at this stage.

What I am inclined to do is have the rewriter reject conditional rules
that contain NOTIFY. That seems like the minimal restriction that will
prevent a crash or incorrect behavior. Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-01-26 18:41:54 Re: beta3 Solaris 7 (SPARC) port report
Previous Message Felix König 2001-01-26 18:27:24 Trouble porting postgreSQL to WinNT