From: | Hannu Krosing <hannu(at)2ndQuadrant(dot)com> |
---|---|
To: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: trigger functions broken? |
Date: | 2008-10-08 19:06:28 |
Message-ID: | 1223492788.7172.5.camel@huvostro |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 2008-10-08 at 20:56 +0200, A. Kretschmer wrote:
> am Wed, dem 08.10.2008, um 14:29:23 -0400 mailte Alvaro Herrera folgendes:
> > Hi,
> >
> > Trigger functions are supposed to be able to be called only as triggers,
> > but apparently the check is not working in CVS HEAD:
> >
> > alvherre=# create or replace function foo () returns trigger as $$ begin perform 1; return new; end; $$ language plpgsql;
> > CREATE FUNCTION
> > alvherre=# select foo();
> > foo
> > -----
> >
> > (1 fila)
>
>
> And?
>
> The function returns a TRIGGER, not a value.
Can you do anything with this TRIGGER value ?
pl/python's approach seems saner to me:
hannu=# create or replace function foo () returns trigger as
$$ return $$
language plpythonu;
CREATE FUNCTION
hannu=# select foo ();
ERROR: trigger functions can only be called as triggers
-------------------
Hannu
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2008-10-08 19:30:48 | Re: trigger functions broken? |
Previous Message | A. Kretschmer | 2008-10-08 18:56:11 | Re: trigger functions broken? |