Re: ALTER TABLE ADD COLUMN takes forever - Mailing list pgsql-admin

From Devendra Yadav
Subject Re: ALTER TABLE ADD COLUMN takes forever
Date
Msg-id CAE+tJY_Xyf+k=oxy=KYo6bjnbeS0sFA4SxmYrYs=6h6toV1ebA@mail.gmail.com
Whole thread Raw
In response to Re: ALTER TABLE ADD COLUMN takes forever  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: ALTER TABLE ADD COLUMN takes forever
List pgsql-admin
Hello Laurenz,

Thanks for your response

We are using PostgreSQL v12.1
There are no open transactions as the table is not blocked by any pid. However when i check pg_locks it say granted=false
but nothing blocking it. Bit strange!!

Regards,
Devendra Yadav
On Mon, 29 Mar 2021, 22:44 Laurenz Albe, <laurenz.albe@cybertec.at> wrote:
On Mon, 2021-03-29 at 22:38 +0530, Devendra Yadav wrote:
> I am running a query on a table - ALTER TABLE mytable ADD COLUMN deposited DOUBLE PRECISION DEFAULT 0.0;
>
> this query just runs forever.

Then either you are using a PostgreSQL version older than v11, or there
is an open transaction that used the table and blocks you.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

pgsql-admin by date:

Previous
From: Devendra Yadav
Date:
Subject: Re: ALTER TABLE ADD COLUMN takes forever
Next
From: "Campbell, Lance"
Date:
Subject: Temporary Files