Re: Questions of 'for update'

2019-06-10 Thread Zhenghua Lyu
Thanks so much. I understand now. Best Regards, Zhenghua Lyu On Mon, Jun 10, 2019 at 3:22 PM Kuntal Ghosh wrote: > On Mon, Jun 10, 2019 at 12:42 PM Etsuro Fujita > wrote: > >> Hi, >> >> On Mon, Jun 10, 2019 at 3:50 PM Kuntal Ghosh >> wrote: >> > On Mon, Jun 10, 2019 at 11:31 AM Zhenghua Lyu

Re: Questions of 'for update'

2019-06-10 Thread Kuntal Ghosh
On Mon, Jun 10, 2019 at 12:42 PM Etsuro Fujita wrote: > Hi, > > On Mon, Jun 10, 2019 at 3:50 PM Kuntal Ghosh > wrote: > > On Mon, Jun 10, 2019 at 11:31 AM Zhenghua Lyu wrote: > >> 2. Is the case above a bug or a feature? > >> > > IMHO, it looks like an expected behaviour of a correct transactio

Re: Questions of 'for update'

2019-06-10 Thread Etsuro Fujita
Hi, On Mon, Jun 10, 2019 at 3:50 PM Kuntal Ghosh wrote: > On Mon, Jun 10, 2019 at 11:31 AM Zhenghua Lyu wrote: >> 2. Is the case above a bug or a feature? >> > IMHO, it looks like an expected behaviour of a correct transaction management > implementation. This is documented behavior; see the C

Re: Questions of 'for update'

2019-06-09 Thread Kuntal Ghosh
Hello, On Mon, Jun 10, 2019 at 11:31 AM Zhenghua Lyu wrote: > > 1. why after emitting `lockrows` plannode, the result can no longer be > assumed sorted? > The plan corresponding to your select query is as following: QUERY PLAN --- Limit -> LockRows

Questions of 'for update'

2019-06-09 Thread Zhenghua Lyu
Hi, I am reading the code that generating plan for `rowmarks` of Postgres 9.4 ( https://github.com/postgres/postgres/blob/REL9_4_STABLE/src/backend/optimizer/plan/planner.c#L2070 ) After emitting the `LockRows` plannode, the results cannot be considered in order, and there are comments ther