pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Check Postgres DB open mode
Date: Thu, 14 Jul 2022 07:41:28 +0200
Message-ID: <2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com> (raw)
In-Reply-To: <CAOzfMupiY3kXE9zQ-V_9OLwbdCVn4g5vdHRuA4nSKNZriWzHBw@mail.gmail.com>
References: <CAOzfMupiY3kXE9zQ-V_9OLwbdCVn4g5vdHRuA4nSKNZriWzHBw@mail.gmail.com>

Am 14.07.22 um 06:13 schrieb Goti:
> Hi Listers,
>
> I am new to postgres and would like to know how to check whether the 
> DB is opened in read write mode or read-only mode.
>
> Thanks,
>
> Goti

Hi Goti,

The PostgreSQL database isn't "opened", but the clients connect to it.

Whether the connection is read-only can be found out by executing the 
command

     show transaction_read_only

Unless you are connected to a standby server, connections will be 
read-write.

Regards,

Holger


-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

view thread (3+ messages)  latest in thread

Message-ID: <2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com>
Permalink:  ../2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com/
Also on:    postgresql.org/message-id/2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Check Postgres DB open mode
  In-Reply-To: <2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com>

* 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