Re: rule problem - Mailing list pgsql-general

From Jan Wieck
Subject Re: rule problem
Date
Msg-id 200203251848.g2PImAq21496@saturn.janwieck.net
Whole thread Raw
In response to rule problem  (<tsmets@brutele.be>)
List pgsql-general
tsmets@brutele.be wrote:
>
> [...]
>
> I thought I could do smthg like :
> do instead
>     begin work
>         Action_1;
>         Action_2;
>         Action_3;
>     commit work
>
> Could some one suggest a better solution ?
> I have never seen what happens if I set multiple rules.
> Are they applied in the order they were created ?

    You  cannot  and  don't  need  to do BEGIN and COMMIT as rule
    actions.  Write it as

        do instead
        (
            Action_1;
            Action_2;
            Action_3;
        );

    and the actions will be perfomed in that order,  all  in  one
    and the same transaction.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: Another notify question
Next
From: Tom Lane
Date:
Subject: Re: BUG? - Sequence got verry strange id