Hello, On Fri, 2020-02-28 at 01:10 +0000, sivapostgres@xxxxxxxxx wrote: > Then clearly I've misunderstood what advisory lock could do. We > used to put locks in SQL server to avoid deadlock situations. I > thought advisory lock is a similar one. [ New to Postgres ] > > The report is arrived from around 10 tables out of 300 tables that > are in the database. Once we start this process, we need to ensure > that no other user could enter any data in those 10 tables, at least > for the processing period. I thought the table lock [ those 10 > tables ] will ensure no entry. > > We have a menu like this in our application > > Purchase Entry > Sales Entry > Sales Cancellation > Report > Processing report > > When we enter the Processing report and click process, we need to > ensure that no one could enter data from Purchase Entry, Sales Entry, > Sales Cancellation, etc. > If the menu is built from a table in your database, then when "Processing report" starts you could set a flag (boolean) against those items so that if anybody tried to log-in or access those items, you could simply display a message along the lines of "Processing report is running. Please try again later". When "Processing report" finishes, it just clears that flag. HTH, Rob