Re: trigger help - Mailing list pgsql-general

From Michael Fuhr
Subject Re: trigger help
Date
Msg-id 20060822135934.GA56791@winnie.fuhr.org
Whole thread Raw
In response to trigger help  (marcelo Cortez <jmdc_marcelo@yahoo.com.ar>)
Responses Re: trigger help
List 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

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Queries joining views
Next
From: Tom Lane
Date:
Subject: Re: Queries joining views