From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: akattunga@gmail.com
Subject: BUG #16745: delete does not prune partitions on declarative partitioned table
Date: Wed, 25 Nov 2020 21:12:49 +0000
Message-ID: <16745-e765ee2879fea695@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16745
Logged by: Christian Pradelli
Email address: akattunga@gmail.com
PostgreSQL version: 13.1
Operating system: Ubuntu
Description:
Today I upgrade from PG-12 to PG-13
Now I detect that delete does not prune partitions on declarative
partitioned table.
table structure
CREATE TABLE public.fac_item
(
ffacnum integer NOT NULL,
fcoddist character varying(15) COLLATE pg_catalog."default",
fpromoc character varying(1) COLLATE pg_catalog."default",
fvended character varying(15) COLLATE pg_catalog."default",
fcodpro character varying(15) COLLATE pg_catalog."default",
fean character varying(15) COLLATE pg_catalog."default",
fcantid double precision,
ftotal double precision,
ffechai date NOT NULL,
ffechaf date,
fartuni integer,
fimpnum integer,
fsucurs integer,
fpreref numeric(18,6),
fcliint integer,
fdescue double precision,
fvenpre numeric(18,6),
CONSTRAINT pk_fac_item PRIMARY KEY (ffacnum, ffechai)
) PARTITION BY RANGE (ffechai);
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?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, akattunga@gmail.com
Subject: Re: BUG #16745: delete does not prune partitions on declarative partitioned table
In-Reply-To: <16745-e765ee2879fea695@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox