From: rob stone <floriparob@gmail.com>
To: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
To: Postgresql General Group <pgsql-general@lists.postgresql.org>
Subject: Re: Need to find the no. of connections for a database
Date: Fri, 28 Feb 2020 16:38:42 +1100
Message-ID: <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com> (raw)
In-Reply-To: <1151434427.3100461.1582852216341@mail.yahoo.com>
References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com>
<1393516227.2562442.1582789296867@mail.yahoo.com>
<C06A448C-51BC-43B9-A0CF-558F28E0090E@gmx.com>
<1654972450.2631031.1582803351218@mail.yahoo.com>
<72f62e47-689a-351a-a711-6cfb7312d282@wp.pl>
<1401820409.2680701.1582810637855@mail.yahoo.com>
<af11c806-4850-8837-b8ca-89614dc4f49f@wp.pl>
<561727835.2707508.1582813582038@mail.yahoo.com>
<ad504885-51ed-e356-b821-ec9b73dc0810@wp.pl>
<1151434427.3100461.1582852216341@mail.yahoo.com>
Hello,
On Fri, 2020-02-28 at 01:10 +0000, sivapostgres@yahoo.com 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: floriparob@gmail.com, sivapostgres@yahoo.com
Subject: Re: Need to find the no. of connections for a database
In-Reply-To: <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com>
References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com> <1393516227.2562442.1582789296867@mail.yahoo.com> <C06A448C-51BC-43B9-A0CF-558F28E0090E@gmx.com> <1654972450.2631031.1582803351218@mail.yahoo.com> <72f62e47-689a-351a-a711-6cfb7312d282@wp.pl> <1401820409.2680701.1582810637855@mail.yahoo.com> <af11c806-4850-8837-b8ca-89614dc4f49f@wp.pl> <561727835.2707508.1582813582038@mail.yahoo.com> <ad504885-51ed-e356-b821-ec9b73dc0810@wp.pl> <1151434427.3100461.1582852216341@mail.yahoo.com> <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox