Skip site navigation (1) Skip section navigation (2)

Docs for CREATE RULE with WHERE/NOTIFY

From: Dariusz Suchojad <dsuch(at)gefira(dot)pl>
To: pgsql-patches(at)postgresql(dot)org
Subject: Docs for CREATE RULE with WHERE/NOTIFY
Date: 2007-06-24 19:29:25
Message-ID: 467EC615.4020202@gefira.pl (view raw or flat)
Thread:
Lists: pgsql-patches
Hello,

I've just been bitten by this:

dsuch=# CREATE RULE foorule AS ON UPDATE
dsuch-#     TO foo WHERE NEW.x = '1'
dsuch-#     DO ALSO NOTIFY bar;
ERROR:  rules with WHERE conditions may only have SELECT, INSERT, 
UPDATE, or DELETE actions

Here's an explanation 
http://archives.postgresql.org/pgsql-hackers/2001-11/msg00986.php,
but would you also consider applying the following tiny patch to 
create_rule.sgml
to document the behaviour?

thank you,

*** create_rule.sgml.orig	Sun Jun 24 21:09:22 2007
--- create_rule.sgml	Sun Jun 24 21:09:37 2007
***************
*** 176,185 ****
--- 176,187 ----
        <para>
         The command or commands that make up the rule action.  Valid
         commands are <command>SELECT</command>,
         <command>INSERT</command>, <command>UPDATE</command>,
         <command>DELETE</command>, or <command>NOTIFY</command>.
+       Note that <command>NOTIFY</command> is not a valid command if
+       <replaceable class="parameter">condition</replaceable> is 
specified.
        </para>
       </listitem>
      </varlistentry>
     </variablelist>

-- 
Dariusz Suchojad

pgsql-patches by date

Next:From: Magnus HaganderDate: 2007-06-24 19:51:22
Subject: Re: msvc and vista fun
Previous:From: Dave PageDate: 2007-06-24 18:59:12
Subject: Re: msvc and vista fun

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group