On Wed, May 27, 2020 at 6:51 PM Amit Langote <amitlangot...@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