Re: BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error
| От | Tender Wang | 
|---|---|
| Тема | Re: BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error | 
| Дата | |
| Msg-id | CAHewXNmx+UXg46+WUrbPca91bmVipRTpe+SRm19GtxG6mArRhg@mail.gmail.com обсуждение исходный текст  | 
		
| Ответ на | BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error (PG Bug reporting form <noreply@postgresql.org>) | 
| Ответы | 
                	
            		Re: BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error
            		
            		 Re: BUG #19099: Conditional DELETE from partitioned table with non-updatable partition raises internal error  | 
		
| Список | pgsql-bugs | 
Amit Langote <amitlangote09@gmail.com> 于2025年10月30日周四 16:29写道:
I am not really sure if we should play with the planner code.
I suspect the real issue is that we’re assuming partitioned tables
always need a ctid, which wasn’t true before MERGE started using the
root ResultRelInfo. In fact, the old code already looked wrong -- it’s
been requiring a ctid even for partitioned tables where that was never
necessary. We can fix this by only requiring the junk ctid when we
actually operate through the root partitioned table, that is, for
MERGE. Like the attached.
With your patch, this issue didn't happen again.
But I still get a different output when I enable verbose in EXPLAIN,
Output: ctid (enable_partition_pruning = on)
vs 
Output: NULL::oid(enable_partition_pruning = off)
From the user's perspective, it's a bit confusing. 
I agree more with Tom’s opinion — we should throw an error like "cannot delete from foreign table p1"
But the plan only had a dummy root relation; CheckValidResultRel() doesn't work. 
Some other code place may need to do something.
Thanks,
Tender Wang
В списке pgsql-bugs по дате отправления: