| From: | Doug McNaught <doug(at)wireboard(dot)com> |
|---|---|
| To: | "Corn" <corn(at)tryit(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: How to implement transaction in plpgsql? |
| Date: | 2001-09-14 17:28:15 |
| Message-ID: | m3sndphec0.fsf@belphigor.mcnaught.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
"Corn" <corn(at)tryit(dot)com> writes:
> Dear all,
>
> How to implement transaction in plpgsql?
> I have try to use it but fail. And I don't know the reason.
> Here is my function...
You can't use transactions inside a function. The reason is that when
a function executes you are already inside a transaction (every SQL
statement is a transaction if there is no explicit BEGIN) and PG
doesn't support nested transactions.
See the FAQ for more info; I'm pretty sure this issue is in there (if
not, it should be).
-Doug
--
Free Dmitry Sklyarov!
http://www.freesklyarov.org/
We will return to our regularly scheduled signature shortly.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Gould | 2001-09-14 18:40:00 | Re: count of occurences |
| Previous Message | Tauren Mills | 2001-09-14 16:51:36 | Problem with database: FATAL 1: cannot find attribute 24 of relation |