Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j7YMW-0001g1-D7 for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2020 05:39:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7YMU-0000JR-QN for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2020 05:38:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j7YMU-0000JJ-E2 for pgsql-general@lists.postgresql.org; Fri, 28 Feb 2020 05:38:58 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j7YMM-0003uC-Dr for pgsql-general@lists.postgresql.org; Fri, 28 Feb 2020 05:38:56 +0000 Received: by mail-pg1-x532.google.com with SMTP id t24so914057pgj.7 for ; Thu, 27 Feb 2020 21:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=qouysMYdCQP+5p30K2hhP8tzSdJd2BxV7UVfnUAC2Tw=; b=KtRVx9bsAVMtUC0O6Ta1lQOVR4bA+zX107l5oFwGHs/U/pRCW1HF202vmkFqdiUIAe lg1zF9pbqKCB+FaAg+UYx5N9qk3jP2wdEcFbdGorvhUGPdnpYa6E7bbRDjO9LQSTwSh4 VtAIq9RHwUYzetriD7aK0MQ0jfa9zHhSnt1vG7Lt9rTlD138IE05Y8mnZmgp4Q3Q/MAE 1YKHmJZcZ0mNs3C80R+prg/nOgL/SDUsdalTqBzzMdVDWZNuulFuUk9KK+7pK6pv7Kyi E1JI+7tL/CFeGwnTYVKJOpqNPeHQSTRRu3oAsFKZv+XkmhINF8NgqOKtW6Sidwvy9l+q DP/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=qouysMYdCQP+5p30K2hhP8tzSdJd2BxV7UVfnUAC2Tw=; b=FH8hLOq0KwVdCSL9r/u0p6Kb8ZI1eb3z1myUM7o84wC+l7K0lR0tCc7wq7dVRCxxtq ykhEQobAGnvXtuunzKPNlkoeFrRafqJnzjeGv8h7RFT8tXe+RkOVW0Urm2jIl3KBiGJw MPN21QDEJyBiS2CHcr+y0zFla/IcqdLI6+SmDIZ4/4ZpyiR3lnQyoZpPWV1l75t9L1+Z iwmI9eIEk92y2XUPrI4Y4tf5NK4ciuNhXTWJFhO1cpDodGqhVCjncYli9xVGVL5q+gCS U6voO0zm8B/GwvSYwiJ5iEzyBIg/Ql+FVcq533mGzZnolj8ceC2MYIPfS3Usplc0XG9t 2kqA== X-Gm-Message-State: APjAAAXhx7tmDweJ3U95pPLHzpO6LlGPhqbvm7k5VHaEnuOtXSjN2Ffh zEHFofXsmTcl2dASPr9jhqw= X-Google-Smtp-Source: APXvYqxbR7lxy9R/brJvA2d6fTHJkpLwt7WNwNvc0C44efrZepnpaONeLoxdPM7QojeEBTkp6tva9Q== X-Received: by 2002:a05:6a00:2ba:: with SMTP id q26mr1459893pfs.249.1582868327857; Thu, 27 Feb 2020 21:38:47 -0800 (PST) Received: from roblaptop ([202.53.40.61]) by smtp.gmail.com with ESMTPSA id 133sm9753265pfy.14.2020.02.27.21.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 21:38:47 -0800 (PST) Message-ID: <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com> Subject: Re: Need to find the no. of connections for a database From: rob stone To: "sivapostgres@yahoo.com" , Postgresql General Group Date: Fri, 28 Feb 2020 16:38:42 +1100 In-Reply-To: <1151434427.3100461.1582852216341@mail.yahoo.com> References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com> <1393516227.2562442.1582789296867@mail.yahoo.com> <1654972450.2631031.1582803351218@mail.yahoo.com> <72f62e47-689a-351a-a711-6cfb7312d282@wp.pl> <1401820409.2680701.1582810637855@mail.yahoo.com> <561727835.2707508.1582813582038@mail.yahoo.com> <1151434427.3100461.1582852216341@mail.yahoo.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.1-4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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