How to check whether table is busy or free before running the ALTER or creating TRIGGER on that table

Started by Raghavendra Rao J S Vover 7 years ago2 messagesgeneral
Jump to latest
#1Raghavendra Rao J S V
raghavendrajsv@gmail.com

*Hi All,*

We have thousands of tables. Out of these tables we have few tables. Which
are busy some times. If I execute any ALTER statement or creating trigger
on those tables I am unable to do it. How to check whether table is busy or
free before running the *ALTER/DDL *or creating *TRIGGER *on that table in
postgresql database.

--
Regards,
Raghavendra Rao J S V

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Raghavendra Rao J S V (#1)
Re: How to check whether table is busy or free before running the ALTER or creating TRIGGER on that table

On 08/21/2018 06:25 AM, Raghavendra Rao J S V wrote:

*Hi All,*

We have thousands of tables. Out of these tables we have few tables.
Which are busy some times. If I execute any ALTER statement or creating
trigger on those tables I am unable to do it. How to check whether table
is busy or free before running the *ALTER/DDL *or creating *TRIGGER *on
that table in postgresql database.

Take a look at:

https://www.postgresql.org/docs/10/static/view-pg-locks.html

--
Regards,
Raghavendra Rao J S V

--
Adrian Klaver
adrian.klaver@aklaver.com