Re: Defining and Using variables in a postgres function

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Defining and Using variables in a postgres function
Дата
Msg-id 20070202182054.GA6468@wolff.to
обсуждение исходный текст
Ответ на Re: Defining and Using variables in a postgres function  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general
On Fri, Feb 02, 2007 at 17:18:39 +0100,
  Alban Hertroys <alban@magproductions.nl> wrote:
>
> You can do this:
> INSERT INTO tbl_email (option_public, agency, id)
>     SELECT $1, $2, MAX(id) + 1
>     FROM xyz;
>
> I just realize you don't so much need a lock, you need a serialized
> transaction. I can't say I know a lot about locks, I usually prevent
> needing them.

No, a serialized transaction isn't good enough. You need predicate locking,
which postgres doesn't have. So you need to use lock table to do effectively
the same thing with a more blunt instrument.

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

Предыдущее
От: pgsql-user
Дата:
Сообщение: Rule, update and aggregate functions
Следующее
От: Mark Walker
Дата:
Сообщение: Re: Rule, update and aggregate functions