Re: Docs patch to note that rules only get run once per query.

From: Sean Reifschneider <jafo(at)tummy(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-docs(at)postgresql(dot)org
Subject: Re: Docs patch to note that rules only get run once per query.
Date: 2003-04-14 17:53:25
Message-ID: 20030414175325.GK7507@tummy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Apr 14, 2003 at 06:38:16PM +0200, Peter Eisentraut wrote:
>This can't possibly be true. Rules are never invoked "after" any deletion
>of any row. Take a close look at the examples of update rules in the

I'm open to you suggesting a different way of saying the above. I
understand that rules aren't really invoked, but that's what I came up
with to describe what I was seeing.

After a review of my SQL, I made a post to the bugs list about it and
the only reply I got was that the problem I was seeing was due to rules
only doing their thing once per query. In my case, it seemed like the
rule SQL was being executed after the first deletion. This worked fine
if I was doing a single deletion, but would muck things up if I was
doing a multi-column deletion.

A full description including a sample of how to reproduce it is in my
original bugs posting, available at:

http://archives.postgresql.org/pgsql-bugs/2003-03/msg00098.php

>The rule will expand your initial command to a big and ugly set of
>commands. But all those commands are applied like any normal command that
>you could have entered by hand. So if too few or too many rows are
>affected, that's because of the conditions attached to the command.

I would welcome a solution. I tried a number of different mechanisms
for doing the updates I want using rules, but wasn't able to find one
that would do the right thing.

Thanks,
Sean
--
The question of whether a computer can think is no more interesting than the
question of whether a submarine can swim." -- Edsgar W. Dijkstra (1930-2002)
Sean Reifschneider, Inimitably Superfluous <jafo(at)tummy(dot)com>
tummy.com, ltd. - Linux Consulting since 1995. Qmail, Python, SysAdmin

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruno Baguette 2003-04-16 09:10:43 Is there a PDF version of the PostgreSQL 7.3.2 documentation ?
Previous Message Peter Eisentraut 2003-04-14 16:38:16 Re: Docs patch to note that rules only get run once per query.