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 1oBxWt-00036s-Ko for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jul 2022 12:01:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oBxWs-0005Ai-H5 for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jul 2022 12:01:14 +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 1oBxWs-0005AY-50 for pgsql-admin@lists.postgresql.org; Thu, 14 Jul 2022 12:01:14 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oBxWp-0002RW-V4 for pgsql-admin@lists.postgresql.org; Thu, 14 Jul 2022 12:01:13 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-10c0119dd16so2111576fac.6 for ; Thu, 14 Jul 2022 05:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=I6qSqP0wEUDn1tOaYIHwBf+wSH710BbqmLa0QLCTJlU=; b=KjlSY6w4fM6md6CMExyFrbCQ344ZZpeZATKrYWnHARv19TKQLO7TBzRphOztwLYXdE kDPpLhq3xGPKuUQ3afP5CgvlnQYABA4do8U4JGsh0W8JhDkZak7MTMb5Bq0dXq11uRKD dib1CqpiRSUYJEX8cuGnKSu1xIDYOm10680+qa2NXCBSPCJEq0kT60Bhi9vBbJFum3AJ 1dAGG1y51f2Mixy2Lgi3/Z2Pix4KXTrJpBXBW4HCfoXwzk0fPVs/LNv/f1pBImM+bAC9 U97OhNRiG3TZ1u7eNP4zwR/gJwU5vMyb6LZrpR4jF1M6/jp4lKzN/oLNJSohy1LQc1Xj 7MqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=I6qSqP0wEUDn1tOaYIHwBf+wSH710BbqmLa0QLCTJlU=; b=CxhrDhKDrcET7ZzjX6E43MwbHFtSG7WLHqdXBA5jgalkZUr2GcnyMl2levt2LYVuly IzQG/1P7OAHodA7V+fpss2YXF/RFjEKK5shz5JHtKPkwnt6qMBgyi2Ggtt+1sciZxU7D Hoj+MgMAuBORVQ6yScVEtAgQeGUtXwqRdouzRJW3QCHZrtYGBmh6JLah9lawKQU5Grps WetGQzlOXQyJPJeG+/ePB6yGEa5/iv0pkdJQpnQoNOJ9SF9hEI1t7xYvAt5oVVZ65nZb J1aJjAdRfCnCcBq1VEYe8K19ebO/eKxCRWebwErNE0DNHKq/5O9dVifMuEhKiPXp58Ay XoAg== X-Gm-Message-State: AJIora9gwyLqeM5MHQgkpvDXgmFI/UC8Wic0464+UEaEymyqrTpTUDUq S8zHLAhs7tGr9oSXdfSwfIdmbde9IzU= X-Google-Smtp-Source: AGRyM1tIFzJTut3I8KrDZ8l00DW8ExzCg/AvCDADGFRawBfDI0E7A1ccklwK7/RoqF0hFglChZkQ3w== X-Received: by 2002:a05:6870:e746:b0:10c:2d87:848d with SMTP id t6-20020a056870e74600b0010c2d87848dmr6896007oak.177.1657800069460; Thu, 14 Jul 2022 05:01:09 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id j7-20020a056808034700b003264a325ecdsm549693oie.5.2022.07.14.05.01.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jul 2022 05:01:08 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------wffLmD6U2QDoCPgroCNjPCYt" Message-ID: <9c1a0cca-c078-6261-5b21-a9fc1009d1c0@gmail.com> Date: Thu, 14 Jul 2022 07:01:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: Check Postgres DB open mode Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------wffLmD6U2QDoCPgroCNjPCYt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/13/22 23:13, Goti wrote: > 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. Pedantically, /databases/ are not opened; the /postmaster/ is running or not.  We of course colloquially /say/ that "the database is open" when the postmaster is running. Locally, you can run the command "pg_ctl status", and systemctl probably also has a status option. -- Angular momentum makes the world go 'round. --------------wffLmD6U2QDoCPgroCNjPCYt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 7/13/22 23:13, Goti wrote:
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.

Pedantically, databases are not opened; the postmaster is running or not.  We of course colloquially say that "the database is open" when the postmaster is running.

Locally, you can run the command "pg_ctl status", and systemctl probably also has a status option.

--
Angular momentum makes the world go 'round.
--------------wffLmD6U2QDoCPgroCNjPCYt--