Re: Suggestion: provide a "TRUNCATE PARTITION" command - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Suggestion: provide a "TRUNCATE PARTITION" command
Date
Msg-id 5f752f45-67ff-456b-5904-14b1782576bd@gmx.net
Whole thread Raw
In response to Re: Suggestion: provide a "TRUNCATE PARTITION" command  (Michael Lewis <mlewis@entrata.com>)
Responses Re: Suggestion: provide a "TRUNCATE PARTITION" command  (legrand legrand <legrand_legrand@hotmail.com>)
Re: Suggestion: provide a "TRUNCATE PARTITION" command  (Michael Lewis <mlewis@entrata.com>)
List pgsql-general
Michael Lewis schrieb am 08.01.2021 um 17:47:
>      > For me, it seems too easily error prone such that a single typo in
>      > the IN clause may result in an entire partition being removed that
>      > wasn't supposed to be targeted.
>
>     I don't see how this is more dangerous then:
>
>           delete from base_table
>           where partition_key in (...);
>
>     which would serve the same purpose, albeit less efficient.
>
>
> Delete has a rollback option, and you can dry-run to see impacted rows effectively. Truncate does not.

TRUNCATE can be rolled back as well.



pgsql-general by date:

Previous
From: Michael Lewis
Date:
Subject: Re: Suggestion: provide a "TRUNCATE PARTITION" command
Next
From: legrand legrand
Date:
Subject: Re: Suggestion: provide a "TRUNCATE PARTITION" command