From: Tibor Laszlo <ltibor@mail.tiszanet.hu>
To: pgsql-interfaces@postgresql.org
Cc: Zolof <zolof@club-internet.fr>
Subject: Re: pl/pgSQL & transaction
Date: Fri, 19 Jan 2001 11:24:18 +0100
Message-ID: <01011911292000.01181@tir> (raw)
In-Reply-To: <9478lh$1m2r$2@news.tht.net>
References: <9478lh$1m2r$2@news.tht.net>
> This code doesn't work. I use Begin Work to start a transaction but BEGIN is
> a PL/pgSQL command so I have a parse error when executing it.
>
> CREATE FUNCTION a () RETURNS int4 AS '
> BEGIN
> BEGIN WORK;
> COMMIT WORK;
> return 1;
> END;
> ' LANGUAGE 'plpgsql';
>
> What's wrong ????
Is it possible to use transactions in PL/pgSQL functions? AFAIK these functions
always(?) in a transaction (eg as triggers or as stored pprocs) and PostgreSQL
doesn't support nested transactions.
--
Tibor Laszlo
ltibor@mail.tiszanet.hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: ltibor@mail.tiszanet.hu, zolof@club-internet.fr
Subject: Re: pl/pgSQL & transaction
In-Reply-To: <01011911292000.01181@tir>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox