From: | Christian <akattunga(at)gmail(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: BUG #16745: delete does not prune partitions on declarative partitioned table |
Date: | 2020-11-25 23:46:14 |
Message-ID: | CAFD6L64G8Uap+4BTq1_R6EicpGSo4Au6W79t8sJ89n0YuDXkZQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Yes, it works fine in both cases, it only use the right partition.
El mié, 25 nov 2020 a las 19:42, David G. Johnston (<
david(dot)g(dot)johnston(at)gmail(dot)com>) escribió:
> On Wed, Nov 25, 2020 at 3:34 PM Christian <akattunga(at)gmail(dot)com> wrote:
>
>> 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?
>>
>
> Does:
>
> EXECUTE sql USING DSTCOD, SUCCOD, etc...
> sql = ... where FCODDIST=$1 AND FSUCURS=$2, etc...
> work?
>
> or
>
> format(sql, DSTCOD, etc...)
> sql = ... where FCODDIST=%L AND FSUCURS=%L, etc...
>
> David J.
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Smith | 2020-11-26 01:16:50 | Re: BUG #16643: PG13 - Logical replication - initial startup never finishes and gets stuck in startup loop |
Previous Message | David G. Johnston | 2020-11-25 22:41:50 | Re: BUG #16745: delete does not prune partitions on declarative partitioned table |