Re: Truncate DUMMY_mid is blocked DELETE DUMMY_init TABLE

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: M Sarwar <sarwarmd02(at)outlook(dot)com>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Truncate DUMMY_mid is blocked DELETE DUMMY_init TABLE
Date: 2024-06-06 07:58:09
Message-ID: f4fdb3876763f5a3b38bb9a2bd6972e2dd2b5846.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2024-06-05 at 21:23 +0000, M Sarwar wrote:
> Today I have an interesting observation.
> I am truncating the table DUMMY_mid .
> Truncate is getting struck due to DELETE operation on the table DUMMY_init.
>
>
> When I take a look at the PG_STAT_ACTIVITY table, it is confirmed that
> the TRUNCATE is blocked by  DELETE on DUMMY_INIT table.
> This seems to be strange to me.

In "pg_stat_activity", you only see the last SQL statement that was executed
on that connection. There might have been other SQL statements earlier in the
same transaction that read or in some other way used "DUMMY_mid".

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2024-06-06 08:06:09 Re: Minimize checkpointer and walwriter io during pg_restore
Previous Message M Sarwar 2024-06-05 22:21:56 Re: Truncate DUMMY_mid is blocked DELETE DUMMY_init TABLE