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 1j7G4w-000070-TG for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 10:07:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7G4v-0000A2-Kr for pgsql-general@arkaria.postgresql.org; Thu, 27 Feb 2020 10:07:37 +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 1j7G4v-00009u-BI for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 10:07:37 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7G4s-0002Ie-9L for pgsql-general@lists.postgresql.org; Thu, 27 Feb 2020 10:07:36 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id F049425A7; Thu, 27 Feb 2020 11:07:32 +0100 (CET) Date: Thu, 27 Feb 2020 11:07:32 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Need to find the no. of connections for a database Message-ID: <20200227100732.GB22375@hjp.at> References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com> <1393516227.2562442.1582789296867@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" Content-Disposition: inline In-Reply-To: <1393516227.2562442.1582789296867@mail.yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --xXmbgvnjoT4axfJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-02-27 07:41:36 +0000, sivapostgres@yahoo.com wrote: > Before taking a few reports, we need to ensure that only one connection i= s made > to the database and all other computers need to close the connection to t= hat > database. This is to prevent any additional entry(ies) that could be ma= de > during the course of the report taking. Do you have control over those reports or are they generated by a third-party tool? If the former, the best way is probably to just run them all in a single REPEATABLE READ transaction. Then they will all reflect the state of the database at the start of the transaction, regardless of what other clients are doing in the meantime. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl5XlOQACgkQ8g5IURL+ KF2xHA/9GV/StCIy6g1rEvVph2VbDQxvNO+rKItFxbImgJb6D/Afbqa+MQu8xkOP nZFjTrEqmX9Hl3XOiKkn4LFAVGujR8A+lugi7krBdDpJ0ciU3wTwUvttPogjTHXM Tstl27KCgX0jwknMZYhCuqgYkas+lLgehhwlN5TGkatrrrMURH3tg8pOeMTTbOiD g7Q4V/PMwjdf42cL+EBIrrrGHoAQeuSthyPZgJIcXh1IYN2AD0ADgzP8qhf7IdM0 UWQEC+/Fhxobhhzgw4qyb84ayidBCSHDWGQHVKSITGFT4xN797SmopPugu4YcYNz gu62EYORALCn5nQw0//955+AiFfoXGx36XhcCdEDnKolhxzfdo43CwyYTKvKNuUU Q5jTVnyF2m0L740/R+iRXtqDQHlrWYMyyHREsH2q8LKPelfD9N1tHmZ9k+VsjqTs uD25pWoBUNF2oAWMynjMHX2IVhygiTjFpPC3g6RAxFNqnkJI+3Y6+XsKtzwWcCJO q8PEfzzgeeLO74yLthgm61mOM8FxqfwsMrTQ+ByTOBQn6fYcVxp4gO0PH96zDyuQ bcQ/KPWM0fCsnSCwGNdcaIvUGPch2NxOy0V6rm3aVtoCB6Xcg1ackiLuaiyk2403 szEDb9Ce31osghfjrimtyV123C0EGtc8Gbx+TCXKyIyoYfzNv9k= =SUvv -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE--