Re: PLPGSQL: Using Transactions and locks

From: "Gregory Wood" <gregw(at)com-stock(dot)com>
To: "Allan Kamau" <hugebirdwings(at)yahoo(dot)com>
Cc: "PostgreSQL-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PLPGSQL: Using Transactions and locks
Date: 2001-06-13 13:47:09
Message-ID: 00dd01c0f40f$6417ebf0$7889ffcc@comstock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> How do I write transaction statements like 'BEGIN
> WORK'... in PLPGSQL.

You can't... the function is already running within a transaction (implicit
or explicit) and PostgreSQL doesn't have any nested transactions, therefore
you can't start a transaction from within a function.

> Also how do I write lock statements in the same.

I'm not sure what you're trying to do, but I think SELECT ... FOR UPDATE
would work in this context.

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-06-13 13:51:46 Re: Re: Does PostgreSQL support EXISTS?
Previous Message Tom Lane 2001-06-13 13:42:21 Re: Re: very big problem with NULL