On Thu, 2013-10-03 at 11:53 -0700, bricklen wrote:
>
> On Thu, Oct 3, 2013 at 11:48 AM, Michael Graham <mgraham@bloxx.com>
> wrote:
> Hi all,
>
> We partition the data in postgres in a per-month basis and run
> a script
> to delete old partitions.
>
>
> Does "delete" = "drop"?
No I'm truncating the tables for that partition (sorry I should have
made that clear in my original message).
> Sometimes this script fails and the delete
> doesn't happen because of a deadlock, today I noticed that it
> was the
> autovacuumer that fighting with the script.
>
>
> Are you uninheriting the partition before attempting to get rid of it?
> Eg.
>
> ALTER TABLE your_partition NO INHERIT the_parent_table;
I'm not no, will that help? I see that the autovacuumer is vacuuming
the actual partition that I want to truncate to the parent but I do do
an analyse on the parent table after the truncate but in the same
transaction.
Thanks,
--
Michael Graham <mgraham@bloxx.com>