Re: TRIGGER with WHEN clause - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Re: TRIGGER with WHEN clause
Date
Msg-id 4B01317C.3050308@kaigai.gr.jp
Whole thread Raw
In response to Re: TRIGGER with WHEN clause  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Responses Re: TRIGGER with WHEN clause
List pgsql-hackers
Albe Laurenz wrote:
> SQL> CREATE TRIGGER dummy BEFORE DELETE ON employees WHEN (1 = 1)
>   2  BEGIN
>   3  END;
>   4  /
> CREATE TRIGGER dummy BEFORE DELETE ON employees WHEN (1 = 1)
>                                                 *
> ERROR at line 1:
> ORA-04077: WHEN clause cannot be used with table level triggers

Thanks for your information.

> I am also not sure about Oracle, but I think there are usage of
> statement trigger with WHEN cluase something like:
>   =# CREATE TRIGGER log_trig BEFORE UPDATE ON tbl
>        WHEN (is_superuser()) EXECUTE PROCEDURE log_current_stmt();

Itagaki-san, I also think your example usage is enough valueable.
However, Oracle does not have the feature apparently, although the
purpose of this patch is to provide a compatible feature, IIRC.

I don't have any preference on either of them.
If you make a decision, I'll review the patch according to your
decision. So, I like to ask you which is your preference again.

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>


pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: ECPG patch 3, DESCRIBE [OUTPUT] support
Next
From: Boszormenyi Zoltan
Date:
Subject: ECPG patch 4, out-of-scope cursor support in Informix-mode