Dear David,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.
You want to exclusively lock a table during every insert just because something might run a concurrent reindex?
If you want to write a higher-level locking scheme for your system and not use what is provided natively by PostgreSQL that's your choice. Its not worth volunteering my time to help do that, though. The docs have considerable info regarding explicit locking using the LOCK command. You should start there.
I see in a subsequent response that you have doubts that REINDEX is actually working properly. If you are able to demonstrate that maybe the underlying problem could be addressed.
David J.