Re: - Mailing list pgsql-admin

From Tom Lane
Subject Re:
Date
Msg-id 2800078.1617111703@sss.pgh.pa.us
Whole thread Raw
In response to  (Devendra Yadav <devendra.857@gmail.com>)
List pgsql-admin
Devendra Yadav <devendra.857@gmail.com> writes:
> We are running on PostgreSQL v 12.1 , Redhat 7.8.
> We are running a query  - ALTER TABLE mytable ADD COLUMN deposited DOUBLE
> PRECISION;
> This query is blocked by pid 0. It's not a postgres PID and won't allow to
> terminate from postgres.

It would be better if you showed the evidence that makes you think this,
as it's fairly likely that the true problem is somewhere else than
you think.

At a guess, however, a pg_locks display that suggests a lock is held
by "pid 0" might be trying to represent a lock held by a prepared-but-
uncommitted transaction.  Try looking into the pg_prepared_xacts view.

            regards, tom lane



pgsql-admin by date:

Previous
From: Devendra Yadav
Date:
Subject: Re: ALTER TABLE ADD COLUMN takes forever
Next
From: Hotmail
Date:
Subject: Performance bottleneck. High active sessions but postmaster kernel threads are in a sleep state, low CPU utilization