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 1j7JqW-0007hM-PE for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 14:09:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7JqV-0001A5-Ky for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 14:08:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j7JqV-00019y-3j for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 14:08:59 +0000 Received: from mx3.wp.pl ([212.77.101.9]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7JqR-0001Wf-Tj for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 14:08:57 +0000 Received: (wp-smtpd smtp.wp.pl 4805 invoked from network); 27 Feb 2020 15:08:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1582812531; bh=9K2ixzKDL2ZtgBFjrwTCVaMaz3RIkFC9DFB2StEZxXU=; h=Subject:To:From; b=L8Dltnk3l0DAtMMmRQ61ul3kQghroCNZfTWBza5uoThoOAxbKvPSUXklc48iIds+j Z3aTS4uqkrPkjdQdcOZiIEOCQ9DP5cYkaA0fhbrmqMgE2qgr9BHpK5gQOp7KuevVaQ jxvJ8q9lfKgRSXimAAssiijjWzpun/TJhNGgKJT0= Received: from 78-11-36-98.cmr.net.pl (HELO [192.168.1.226]) (ipluta@wp.pl@[78.11.36.98]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 27 Feb 2020 15:08:51 +0100 Subject: Re: Need to find the no. of connections for a database To: "sivapostgres@yahoo.com" , "pgsql-generallists.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> From: "Ireneusz Pluta/wp.pl" Message-ID: Date: Thu, 27 Feb 2020 15:08:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1401820409.2680701.1582810637855@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pl X-WP-MailID: c80ce755a365dd9fe3e9a3b6beffdc5e X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000009 [gBMk] List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk W dniu 2020-02-27 o 14:37, sivapostgres@yahoo.com pisze: > Hello, > > I'm saying isolation will not work out to my requirement.   The steps. > > 1.  On completion of all entries by all,  say for a day. > 2.  Lock, so that no one enters any other data. > 3.  Create a report from the entered data. > 4.  Create / Modify required entries from the values arrived in the report. [ long process ] > 5.  Once completed, commit all data. > 6.  Unlock, so that other users can enter data again.  Data entered will be for another date.  > Data cannot [should] not entered for the processed date. > so wouldn't pg_advisory_lock() in step 2, and pg_advisory_unlock() in step 6, make the process work in the way you expect? https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS > > > On Thursday, 27 February, 2020, 06:29:00 pm IST, Ireneusz Pluta/wp.pl wrote: > > > W dniu 2020-02-27 o 12:35, sivapostgres@yahoo.com pisze: > > > I need to prevent other users from entering any transaction till I finish taking reports from my > > application.  All users will be using the same application, from which this report is supposed to > > be printed. > > > > maybe advisory lock is what you need? > > https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS > > > >