Re: BUG #16745: delete does not prune partitions on declarative partitioned table

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Дата
Msg-id CAKFQuwYnmqOWDm2HHXd2H0yFmaw2pYE-N=UdzDbYe4FH54X9oQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #16745: delete does not prune partitions on declarative partitioned table  (Christian <akattunga@gmail.com>)
Ответы Re: BUG #16745: delete does not prune partitions on declarative partitioned table  (Christian <akattunga@gmail.com>)
Список pgsql-bugs
On Wed, Nov 25, 2020 at 3:34 PM Christian <akattunga@gmail.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.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Christian
Дата:
Сообщение: Re: BUG #16745: delete does not prune partitions on declarative partitioned table
Следующее
От: Christian
Дата:
Сообщение: Re: BUG #16745: delete does not prune partitions on declarative partitioned table