pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Need to find the no. of connections for a database
Date: Thu, 27 Feb 2020 11:07:32 +0100
Message-ID: <20200227100732.GB22375@hjp.at> (raw)
In-Reply-To: <1393516227.2562442.1582789296867@mail.yahoo.com>
References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com>
	<1393516227.2562442.1582789296867@mail.yahoo.com>

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 is made
> to the database and all other computers need to close the connection to that
> database.   This is to prevent any additional entry(ies) that could be made
> 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

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (14+ messages)  latest in thread

Message-ID: <20200227100732.GB22375@hjp.at>
Permalink:  ../20200227100732.GB22375@hjp.at/
Also on:    postgresql.org/message-id/20200227100732.GB22375@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Need to find the no. of connections for a database
  In-Reply-To: <20200227100732.GB22375@hjp.at>
  References: <1393516227.2562442.1582789296867.ref@mail.yahoo.com> <1393516227.2562442.1582789296867@mail.yahoo.com> <20200227100732.GB22375@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox