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