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 1j7YmF-0002M7-Of for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2020 06:05:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7YmE-0007qu-Gb for pgsql-general@arkaria.postgresql.org; Fri, 28 Feb 2020 06:05:34 +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 1j7YmE-0007qn-4f for pgsql-general@lists.postgresql.org; Fri, 28 Feb 2020 06:05:34 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j7YmB-00048s-LJ for pgsql-general@lists.postgresql.org; Fri, 28 Feb 2020 06:05:33 +0000 Received: by mail-io1-xd2e.google.com with SMTP id w9so2171596iob.12 for ; Thu, 27 Feb 2020 22:05:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=9srfU0fCtsEZOWDaFIwVtjahKnN2uo28hBbPc5gEXjo=; b=LgAmZ9r8eyOdtIlCHuFYFNftzmQpGsy52Z41fYniJC5F5A8TnGhluzH+pifsOSfmqQ HYUQFgquV+Xd79qxxjVvd2GnNUmtUu/SdS8pzvesEZ10h6YW19trhQvRgrVJwyAIYtfw cTvojrDm8MhqdJLMbLIhBT5VS553ZGXn5uREauFqlmFl5WPLg/Ylz/QquPdjyGCRK/Gr mxzqO0iGJTi7Zkqogp+/6B/OZZRGdyq1NCrJXNjD+dPxcB6XMNdHMX1LP8c+hFSmm+sV JOX163LskrssFckF+Q8id2qPafnDQDa5ZsCZv8tAA9Z1Fs5cyS4bNUmHY9akdVuuK3Ts DqNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=9srfU0fCtsEZOWDaFIwVtjahKnN2uo28hBbPc5gEXjo=; b=r2RCVo2A/o07Yr6mQOtqtiNCchvMl8P9v5KzqpSS5jvwcjZbjweZQ2h/GTtMIq/8a+ WGr42USIkm/8Pl5lvT8CjwxG4SRnSp4+nLq9yR9q6hcx+GfWXzMtielF+gL4IlMO8pBA yZmE5h1mZQ6YhqDz/MnLe9heLgVRV8/GVhr7Nuax76u7ZbTHe1gH6Vj0uqTnllfw4QuS /9jKp2dr9k7fk1DxJeukgF6Z7Xd5nagABQbnnZ4rwLwFYCRJ8jJ4ggqtR0dvyhOg9X61 1W12CrsJnlcjeoWbqkM8/rqqMvqlzMpNbbCM4KQ2J4mAn+uE75pxxJkcH7CmJUq4S5nS MDhg== X-Gm-Message-State: APjAAAXs+vMGhpVtWz0ZJkMAMQEiM8MowAqtWr5rmjACO0EISuzB2hw8 ljhUvf98nAzDPhHkssrAjbrnhxsL X-Google-Smtp-Source: APXvYqzymjnssAhDaCHWKwHnlMY/y0fMdcEZOb+uW44XPSzKrmO4wjDXbePr4EifKztaYIzLQqdskQ== X-Received: by 2002:a02:2a05:: with SMTP id w5mr580749jaw.96.1582869929477; Thu, 27 Feb 2020 22:05:29 -0800 (PST) Received: from [172.16.12.100] (c-73-63-59-118.hsd1.ut.comcast.net. [73.63.59.118]) by smtp.gmail.com with ESMTPSA id q16sm435773ioh.49.2020.02.27.22.05.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Feb 2020 22:05:28 -0800 (PST) Subject: Re: Need to find the no. of connections for a database To: pgsql-general@lists.postgresql.org 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> <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com> From: Rob Sargent Message-ID: Date: Thu, 27 Feb 2020 23:03:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <35e84a26ea748f8f318069fd235d5201b5eb8dfa.camel@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/27/20 10:38 PM, rob stone wrote: > > 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 > Conversely, the OP could be asking for a way to turn "process report" to active state when no one is using the other features: each of them could set a lock/counter I guess and when all counters are zero enable process button.  The notion of waiting for "all clear" from the app or the db before running reports does seem odd though.  Do certain actions from the app leave the database in an inconsistent state and break the report were it run at the same time?