| From: | Michael Fuhr <mike(at)fuhr(dot)org> |
|---|---|
| To: | marcelo Cortez <jmdc_marcelo(at)yahoo(dot)com(dot)ar> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: trigger help |
| Date: | 2006-08-22 13:59:35 |
| Message-ID: | 20060822135934.GA56791@winnie.fuhr.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Tue, Aug 22, 2006 at 10:38:31AM -0300, marcelo Cortez wrote:
> I think my trigger need transaction ,but the pgsql
> compiler refuse to compile 'begin .. commit ' sequence
> I use the perform , to do the works
Functions can't start or end transactions because they're already
being executed in the context of a transaction; you'll have to do
the BEGIN and COMMIT outside the function. However, there is a way
around that restriction: the function could use dblink to connect
to the database as a client and then execute statements over that
connection.
> CREATE OR REPLACE FUNCTION xxxx_create_cache(text)
> RETURNS text AS
This isn't a trigger function. Are you sure "trigger" is the
word you meant?
--
Michael Fuhr
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2006-08-22 14:48:07 | Re: Queries joining views |
| Previous Message | Alban Hertroys | 2006-08-22 13:59:12 | Re: Queries joining views |