Re: BUG #16745: delete does not prune partitions on declarative partitioned table - Mailing list pgsql-bugs

From Christian
Subject Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Date
Msg-id CAFD6L670C1vCP40qo3RAAb3iTmDiB_4bh27HMb0TP+ZQNq+3FQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16745: delete does not prune partitions on declarative partitioned table  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Re: BUG #16745: delete does not prune partitions on declarative partitioned table
List pgsql-bugs
Ok so this is a known issue.

I test the following command and works fine (it select only one partition) but I'm don't like to much the execute command:

execute 'DELETE FROM FAC_ITEM WHERE FCODDIST='''||DSTCOD||''' AND FSUCURS='||SUCCOD||'::integer AND FFECHAI='''||to_char(FECHAI,'yyyy-mm-dd')||''' AND FIMPNUM<>'||IMPNUM;

Is there any other workaround?







El mié, 25 nov 2020 a las 18:58, Tom Lane (<tgl@sss.pgh.pa.us>) escribió:
PG Bug reporting form <noreply@postgresql.org> writes:
> If I execute:
> select * FROM FAC_ITEM WHERE FCODDIST='' AND FSUCURS=1 AND
> FFECHAI=current_date;
> it use only one partition
> but:
> delete FROM FAC_ITEM WHERE FCODDIST='' AND FSUCURS=1 AND
> FFECHAI=current_date;
> scan all partitions

> Is there any regression?

No.  There's work afoot to improve this, but it wasn't any better before.

                        regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #16745: delete does not prune partitions on declarative partitioned table