Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table.
От | Ashutosh Bapat |
---|---|
Тема | Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. |
Дата | |
Msg-id | CAExHW5uqL-em7EeBk6=n7WO=KYzPZz=K4-J2xO41WNx836zKVg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table. (Amit Langote <amitlangote09@gmail.com>) |
Ответы |
Re: Getting ERROR with FOR UPDATE/SHARE for partitioned table.
|
Список | pgsql-hackers |
On Wed, May 27, 2020 at 6:51 PM Amit Langote <amitlangote09@gmail.com> wrote: > > So in Rajkumar's example, the cursor is declared as: > > CURSOR IS SELECT * FROM tbl WHERE c1< 5 FOR UPDATE; > > and the WHERE CURRENT OF query is this: > > UPDATE tbl SET c2='aa' WHERE CURRENT OF cur; Thanks for the clarification. So it looks like we expand UPDATE on partitioned table to UPDATE on each partition (inheritance_planner for DML) and then execute each of those. If CURRENT OF were to save the table oid or something we could run the UPDATE only on that partition. I am possibly shooting in dark, but this puzzles me. And it looks like we can cause wrong rows to be updated in non-partition inheritance where the ctids match? -- Best Wishes, Ashutosh Bapat
В списке pgsql-hackers по дате отправления: