From: fanlijing <fanlijing@cn.fujitsu.com>
To: 'Albe Laurenz' <laurenz.albe@wien.gv.at>
To: pgsql-admin@postgresql.org
Subject: Re: Is there any support like "for update wait N" in PostgreSQL?
Date: Fri, 9 Dec 2011 11:17:36 +0800
Message-ID: <E1DAC77393D04EF991DC898BCB9FAB34@fanlijing> (raw)
In-Reply-To: <D960CB61B694CF459DCFB4B0128514C207348643@exadv11.host.magwien.gv.at>
References: <19472E8115934C528372F048DEB29E99@fanlijing>
<262B52C2DEF844DFB1CB5C81EB02101A@fanlijing>
<D960CB61B694CF459DCFB4B0128514C207348643@exadv11.host.magwien.gv.at>
Hello Laurenz
Thank you for your rapid reply.
Using statement_timeout is indeed the only-way to get a similar
functionality as "for update wait N" in oracle. It doesn't affect the
functionality at all.
As I said in the previous mail that this porting method affects the
functionality, it is finally verified as a bug in my program.
In a work, the porting method has no problem.
Sorry for interrupting you so many times.
Best Regards from a Chinese girl~ (*^__^*)
Yours,
Fan LiJing(范丽菁)
2011-12-9
-----Original Message-----
From: Albe Laurenz [mailto:laurenz.albe@wien.gv.at]
Sent: Wednesday, December 07, 2011 4:08 PM
To: fanlijing *EXTERN*; pgsql-admin@postgresql.org
Subject: RE: Is there any support like "for update wait N" in PostgreSQL?
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: fanlijing@cn.fujitsu.com, laurenz.albe@wien.gv.at
Subject: Re: Is there any support like "for update wait N" in PostgreSQL?
In-Reply-To: <E1DAC77393D04EF991DC898BCB9FAB34@fanlijing>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox