Re: Is there any support like "for update wait N" in PostgreSQL?

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Is there any support like "for update wait N" in PostgreSQL?
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C207348643@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Is there any support like "for update wait N" in PostgreSQL?  ("fanlijing" <fanlijing@cn.fujitsu.com>)
Ответы Re: Is there any support like "for update wait N" in PostgreSQL?
Список pgsql-admin
fanlijing wrote:
> Actually, now I'm confused with another problem, that is:
> Oracle: for update wait 10
> PostgreSQL: no support for the parameter "wait"
>
> What should I do when I'm doing porting on this point?
> If I get rid of the parameter "wait", there would be a dead lock in my
program...
> Is there any support like "for update wait N" in PostgreSQL?
>
> I'm waiting for your reply.
>
> Thank you so much any way.
>
>
########################################################################
####
>
> Following is my porting method, although it avoid the dead-lock
problem, but it affect the
> functionality.
>
> SELECT DOMAIN_ID, DOMAIN_NAME...FOR UPDATE WAIT 10 ORDER BY ...
> ->
> SELECT DOMAIN_ID, DOMAIN_NAME...ORDER BY ... FOR UPDATE

[...]
> queryRunner.update(conn, "set statement_timeout = 10000");
[...]
> Following is the exception when run my program...
[...]
> ....***SqlException: ERROR: canceling statement due to statement
timeout Query: SELECT... ORDER BY ... FOR
> UPDATE Parameters: [yun_SF_18, 0]

There is no "WAIT n" clause in PostgreSQL, and using statement_timeout
as
you did is the only way to get a similar functionality.

But you seem unhappy with this approach.
How does it affect the functionality?

If you use "WAIT n" in Oracle, you will get an error message (ORA-30006)
similar to using statement_timeout in PostgreSQL.

Yours,
Laurenz Albe

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

Предыдущее
От: "fanlijing"
Дата:
Сообщение: Is there any support like "for update wait N" in PostgreSQL?
Следующее
От: Silvio Brandani
Дата:
Сообщение: truncate table in pitr system