Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBrbU-0002IK-KY for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jul 2022 05:41:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oBrbT-0002sC-EE for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jul 2022 05:41:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBrbT-0002rc-3p for pgsql-admin@lists.postgresql.org; Thu, 14 Jul 2022 05:41:35 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBrbO-0007fE-WC for pgsql-admin@lists.postgresql.org; Thu, 14 Jul 2022 05:41:34 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id D05AC380C17; Thu, 14 Jul 2022 07:41:29 +0200 (CEST) Received: from rs.plausibolo.de ([IPv6:::1]) by localhost (h2367442.stratoserver.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id F9-KIZsRh2eX; Thu, 14 Jul 2022 07:41:29 +0200 (CEST) Received: from [192.168.178.28] (ip-037-201-152-231.um10.pools.vodafone-ip.de [37.201.152.231]) by rs.plausibolo.de (Postfix) with ESMTPSA id 7794B380A55; Thu, 14 Jul 2022 07:41:29 +0200 (CEST) Message-ID: <2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com> Date: Thu, 14 Jul 2022 07:41:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0.2 To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Subject: Re: Check Postgres DB open mode In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------Im08Z9MGT0BrPOhwJ6wGYgOo" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------Im08Z9MGT0BrPOhwJ6wGYgOo Content-Type: multipart/mixed; boundary="------------M0PbZbCi8pfzCfopwICfPMM0"; protected-headers="v1" From: Holger Jakobs To: pgsql-admin@lists.postgresql.org Message-ID: <2646aa97-c183-59e5-fa69-43532da700a2@jakobs.com> Subject: Re: Check Postgres DB open mode References: In-Reply-To: --------------M0PbZbCi8pfzCfopwICfPMM0 Content-Type: multipart/alternative; boundary="------------5t9dC1dCCm0UOHJsbUSM0Av4" --------------5t9dC1dCCm0UOHJsbUSM0Av4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 QW0gMTQuMDcuMjIgdW0gMDY6MTMgc2NocmllYiBHb3RpOg0KPiBIaSBMaXN0ZXJzLA0KPg0K PiBJIGFtIG5ldyB0byBwb3N0Z3JlcyBhbmQgd291bGQgbGlrZSB0byBrbm93IGhvdyB0byBj aGVjayB3aGV0aGVyIHRoZSANCj4gREIgaXMgb3BlbmVkwqBpbiByZWFkIHdyaXRlIG1vZGUg b3IgcmVhZC1vbmx5IG1vZGUuDQo+DQo+IFRoYW5rcywNCj4NCj4gR290aQ0KDQpIaSBHb3Rp LA0KDQpUaGUgUG9zdGdyZVNRTCBkYXRhYmFzZSBpc24ndCAib3BlbmVkIiwgYnV0IHRoZSBj bGllbnRzIGNvbm5lY3QgdG8gaXQuDQoNCldoZXRoZXIgdGhlIGNvbm5lY3Rpb24gaXMgcmVh ZC1vbmx5IGNhbiBiZSBmb3VuZCBvdXQgYnkgZXhlY3V0aW5nIHRoZSANCmNvbW1hbmQNCg0K IMKgwqDCoCBzaG93IHRyYW5zYWN0aW9uX3JlYWRfb25seQ0KDQpVbmxlc3MgeW91IGFyZSBj b25uZWN0ZWQgdG8gYSBzdGFuZGJ5IHNlcnZlciwgY29ubmVjdGlvbnMgd2lsbCBiZSANCnJl YWQtd3JpdGUuDQoNClJlZ2FyZHMsDQoNCkhvbGdlcg0KDQoNCi0tIA0KSG9sZ2VyIEpha29i cywgQmVyZ2lzY2ggR2xhZGJhY2gsIFRlbC4gKzQ5LTE3OC05NzU5MDEyDQoNCg== --------------5t9dC1dCCm0UOHJsbUSM0Av4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 14.07.22 um 06:13 schrieb Goti:
=
Hi Listers,

I am ne= w to postgres and would like to know how to check whether the DB is opened=C2=A0in 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

=C2=A0=C2=A0=C2=A0 show transact= ion_read_only

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

Regards,

Holger


--=20
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
--------------5t9dC1dCCm0UOHJsbUSM0Av4-- --------------M0PbZbCi8pfzCfopwICfPMM0-- --------------Im08Z9MGT0BrPOhwJ6wGYgOo Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQScuJCxWJK1p5BOebGKV5yTsxlhugUCYs+siAUDAAAAAAAKCRCKV5yTsxlhuryY AKDBZyCVJ84mxTgr0Ce5TGq8+PfdswCgu0CYJiDkTLJvQuOrgbnOV/HkVeg= =twd/ -----END PGP SIGNATURE----- --------------Im08Z9MGT0BrPOhwJ6wGYgOo--