Re: PLPGSQL: Using Transactions and locks

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Re: PLPGSQL: Using Transactions and locks
Дата
Msg-id 00dd01c0f40f$6417ebf0$7889ffcc@comstock.com
обсуждение исходный текст
Ответ на PLPGSQL: Using Transactions and locks  (Allan Kamau <hugebirdwings@yahoo.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [Help] AGGREGATE problem w/v7.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Does PostgreSQL support EXISTS?