"Corn" <[EMAIL PROTECTED]> 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. ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]