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 1j7K7e-0008BJ-3s for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 14:26:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7K7c-0001kR-WB for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 14:26:40 +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 1j7K7c-0001kK-FE for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 14:26:40 +0000 Received: from sonic306-20.consmr.mail.sg3.yahoo.com ([106.10.241.140]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j7K7Z-0001qu-8n for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 14:26:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1582813592; bh=2YS8tHnmR8Hp6ueoQIk0X5To/Ukpxxd5OftUt5QmeAg=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=HFGt3kcyTZPQ5GE4e5uFa56UNbEwuHz9sZSU+ZUARhi2fjoDM5i//d6oZOKZoLD4xzXRq7beVTLSYLjLE3FkyWPhZqcfKhbJc2F2M6rUoFz0SVAvxPTqmz04yiliuPKwTHY61vtdTuFYtyUIeq4KZgOXZpA6HeN3H7+ZBVL3TZf67jZeoy+E43sEbWlk/zxxwCgc5LHHC+hZiKdb4Eqry28Jm0Z4ovN9JBl3bMHBTHxCxUb5JwdpXk0Syx/8xL+5sYz3iSrRTAm+yrkBoJTtFPHTBBCN2pvJDjkjoC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k3ze2gfnWSHfmG0Cj3s32d3y. laF0YgBmVO8XgfqY3qv7EZu_ntWfo2FaW7RgZEvQ0Vx5F.yhw_bso9USWC1LC1Wr8l3fGrMSIBeq AQnfvG3TkyaMXSxemrbJqAgHTDgUrBcUeVuhouqipMtmg8e40URlKDwM5irPtxZSAEiJBYzOuBlH WLK92DrxX8L79QYCbnpGaoVJqemii8uzuZivH9Sd_tEvIxhshZhu9IAEJ4Lqw_2QoqrYPGaPggSz 9grcXy2UYJ27j6jkRqMDb9ByOEKooypAKsbeQsaYEi6u75VM4oZxpF5.z7j9ShbMVs6Yptj1TZzb 5wc3yg7gXe679mc7b43jipiuyKDF6UdWKmPd11eLZh5vTQVBYh7W3Q5abwRjVSKTM9ZX3FB2vVtd _odDmqIkiZu44hUE- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.sg3.yahoo.com with HTTP; Thu, 27 Feb 2020 14:26:32 +0000 Received: by smtp403.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 4babcf93d962eac654789f881da12e31; Thu, 27 Feb 2020 14:26:28 +0000 (UTC) X-YMail-OSG: IB1tynkVM1mjdqFOrL1TpogrSSabZvGnT1bNEFAepz_Qd_8yWcGrAG.Sr_mIgiW Ux_fvNm_H4WnGK6Ofb3Ec7mwQbvHYlgRlmIMVi286kW.OPnh6tQTKqQmvTtkJ.08DLdJvA14FVGT Ow8eCT7tZXfp__1JXLfhayt62ejrE7AFwPSD7GhGTUNxwvXZt8cG8sUcPY7ElhOqV1M7CcF8J5bY llf63zCZdMiIUVBw1VPzQ2AXoiJfVSp.b1gv5cWN6wcySFVszImOgzsxIefxYa_4Two7eGfZoRQr cTniZIAJvyJamRKs0lPcNOZVSLDkz4yHdvMQ2mrgQgIR_1rCmQNhndRrMtA1D27CQof9QS401nmd BbUzPrnXVvLk_qE_7Oz5PJmQQbR366i4zDqLGsvj7tTY93yxy.wNGUHfnDELnYyEFe2ftnXmgpMk fCKabCds1qIyYeM9v9bXsMLbziG98kAXYw5kmFr1LQlJxU_rUHARHLSbyem0kj4LanH5yGPKEMTV EO1HBcymOODAaa89PvCOpWjh4mRWmU3QFU49zRcCC.r2FBQDFn9d40BvZs_bKpgqsVTpgwCA9AbM _wolDTBRyUc1nBV28PN.yYqINY8xcZymwDVd2lAmcVoE1lHMeM.lZOhHOYWoJ1gX1BNzeLscS5Es ICxEYFY1r34Tv9NKC8hYjATPSPgF1PdErJ33G8R6ME7z8O0zIY2sB8FLDhvfL5dACNnhj_tZg7aU d52oUS.ZcNQPpwQzye2u8VRBBcsySbbvmaMqewtf.KoEogZhWj_t4mYMnuybHfei1BSfL1qyJVxK yHELhlQaTA4F.c6VA4f33IKh6Lb5IH8HnkstkoXnSAYwJpCkuMoWlYlhUDOLh.Czuq_Yj4G2Y1IS QVdpqRGjhnBz4vhCTybgRaY8h2bfy_SJxJcvyHgtENt0mZ80YIQXDjR4drtcTSti.DMm2kXuedoY GRdvKi6O2zwGkFmJuWDE1dVm7rgki6VYIjpavcmAsF29H99R8VsGUJoPMPGoRWnFrg6qSE1e1M5K DmT4T1r44zBPhksThv7HZkabyug8DEp_erm9hOaAeg3lV3ihW_AEIVoQURnQbYd02ad6nafoErZY LwSdoXLRm88TtKLO1RQZ2bpEM8aSiJmrxddLuxPgtwyUjZV8z3gO1jEeKTWiC0D1c0P7c4pt3wmm ngptCak._Vw6ZiFAtcnW0W_f9DRdEJXeo2QZuDUQlRQmC4fTWrq32x87zcnrACHgVpKVZGdCNFcS u2Yy9qwiZvfFVxVJ9xeOHW5B74PxVXdzQVoETASh3bchijGna_5UvX35IoUZ.Sz8mnPjQSA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Thu, 27 Feb 2020 14:26:26 +0000 Date: Thu, 27 Feb 2020 14:26:22 +0000 (UTC) From: "sivapostgres@yahoo.com" Reply-To: "sivapostgres@yahoo.com" To: "pgsql-generallists.postgresql.org" Message-ID: <561727835.2707508.1582813582038@mail.yahoo.com> In-Reply-To: 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> Subject: Re: Need to find the no. of connections for a database MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2707507_27177337.1582813582037" X-Mailer: WebService/1.1.15302 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36 Content-Length: 6050 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2707507_27177337.1582813582037 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Need to lock around 10 tables.=C2=A0 Let me try with=C2=A0pg_advisory_lock= (). On Thursday, 27 February, 2020, 07:39:13 pm IST, Ireneusz Pluta/wp.pl <= ipluta@wp.pl> wrote: =20 =20 W dniu 2020-02-27 o=C2=A014:37, sivapostgres@yahoo.com pisze: > Hello, > > I'm saying isolation will not work out to my requirement.=C2=A0 =C2=A0The= steps. > > 1.=C2=A0 On completion of all entries by all,=C2=A0 say for a day. > 2.=C2=A0 Lock, so that no one enters any other data. > 3.=C2=A0 Create a report from the entered data. > 4.=C2=A0 Create / Modify required entries from the values arrived in the = report. [ long process ] > 5.=C2=A0 Once completed, commit all data. > 6.=C2=A0 Unlock, so that other users can enter data again.=C2=A0 Data ent= ered will be for another date.=C2=A0=20 > 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=20 in the way you expect? https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADVI= SORY-LOCKS > > > On Thursday, 27 February, 2020, 06:29:00 pm IST, Ireneusz Pluta/wp.pl wrote: > > > W dniu 2020-02-27 o=C2=A012:35, sivapostgres@yahoo.com pisze: > > > I need to prevent other users from entering any transaction till I fini= sh taking reports from my > > application.=C2=A0 All users will be using the same application, from w= hich this report is supposed to > > be printed. > > > > maybe advisory lock is what you need? > > https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LO= CKS > > > > =20 ------=_Part_2707507_27177337.1582813582037 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Need to lock around 10 table= s.  Let me try with pg_advisory_lock().


=20
=20
On Thursday, 27 February, 2020, 07:39:13 pm IST, Ireneu= sz Pluta/wp.pl <ipluta@wp.pl> wrote:


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 fro= m the entered data.
> 4.  Create / Modify require= d 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_unloc= k() in step 6, make the process work
in the way you expe= ct?

https://www.postgresql.org/docs/current/functions-adm= in.html#FUNCTIONS-ADVISORY-LOCKS

&= gt;
>
> On Thursday, 27 February,= 2020, 06:29:00 pm IST, Ireneusz Pluta/wp.pl <ipluta@wp.pl> = wrote:
>
>
>= W dniu 2020-02-27 o 12:35, sivapostgres@yahoo= .com <mailto:sivapostgres@yahoo.com> = pisze:

>= ;
> > I need to prevent other users from entering a= ny 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.>
> >
> may= be advisory lock is what you need?
>
> https://www.postgresql= .org/docs/current/explicit-locking.html#ADVISORY-LOCKS
>
>
>
>=


------=_Part_2707507_27177337.1582813582037--