Yogesh Sharma wrote: > I want to apply explicitly lock mechanism once inset operation is in progress then REINDEX will wait. > And vice versa. > So, please let me know this type of handling is possible. Maybe I misunderstand something, but you don't need to do that because it happens automatically. If you run REINDEX, it will take an ACCESS EXCLUSIVE lock on the index before it starts its work. That means that it has to wait until all earlier INSERTing transactions are ended, and all INSERTs that come after the REINDEX will have to wait until the REINDEX is done. The database takes care that the data are consistent, so why would you want to do that explicitly? Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general