Devendra Yadav <devendra.857@xxxxxxxxx> 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