Re: on duplicate key

Поиск
Список
Период
Сортировка
От A B
Тема Re: on duplicate key
Дата
Msg-id dbbf25900809260127xa11f254w6911c807b6934c87@mail.gmail.com
обсуждение исходный текст
Ответ на Re: on duplicate key  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
> Here is the appropriate documentation link, where they have an example:
> http://www.postgresql.org/docs/8.3/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
>
> The primary difference is that they use a loop, which is more robust. In
> theory, if you delete the record between when the INSERT happens and
> when the UPDATE happens, you will get no effect, which isn't what you're
> looking for. The loop will correct for this by ensuring that something
> happens before it terminates.

Yes, it could have been removed.
I seem to remember that it is not possible to lock the table with a
transaction from within a function, this has to be done on  the level
from which I call the function?

> However, you can do the same thing on the command line using
> subtransactions, a.k.a. SAVEPOINTs:
> http://www.postgresql.org/docs/8.3/static/sql-savepoint.html
Oh, fun to learn new stuff :-)
Thank you for your reply

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

Предыдущее
От: "Joey K."
Дата:
Сообщение: ]OT] Database structure question
Следующее
От: Reg Me Please
Дата:
Сообщение: Re: Dynamically created cursors vanish in PLPgSQL