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 1kShFt-0000ZG-D9 for pgsql-general@arkaria.postgresql.org; Wed, 14 Oct 2020 13:55:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kShFq-0003Qw-Ez for pgsql-general@arkaria.postgresql.org; Wed, 14 Oct 2020 13:55:46 +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 1kShFq-0003Qp-5p for pgsql-general@lists.postgresql.org; Wed, 14 Oct 2020 13:55:46 +0000 Received: from mout.gmx.net ([212.227.17.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kShFo-0008WT-3Q for pgsql-general@lists.postgresql.org; Wed, 14 Oct 2020 13:55:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602683742; bh=dBA5szvgUmdD6vgs250Ujz6DkvLm12o1ui4edPrYd9E=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=Mvm+UW31Cs8CwruY6JAZIbhnyR3KPf4cD8bB7QWNC6FJ37e5JV6PcLcrjHv0Z9hDm CIzPlkAqY36SVPNtBgQvscfuNPet6IM4vjPETJ/KHdwNdAPVPQL3xnPQbKV8MAOKIM B2VANdhdI/vU5DRzIuc8vQB4bc0f541pwn41tipU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.1.35.238] ([185.40.248.10]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mxm3K-1kGHWy2Byw-00zF5j for ; Wed, 14 Oct 2020 15:55:42 +0200 Subject: Re: Parameter value from (mb/gb) to bytes To: pgsql-general@lists.postgresql.org References: <6cbca2bcda734464a1be9f7d7380ff33@rik.ee> From: Thomas Kellerer Message-ID: Date: Wed, 14 Oct 2020 15:55:41 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <6cbca2bcda734464a1be9f7d7380ff33@rik.ee> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qua9LxEnn5neI4ASJdm9Jd3uJqkZ0ISUIMVxdEz6B9ewreCokTs VuH/J+cSRD+ZZuB2FVzsRF7mMMjw+o310rg0mVxYua92bVjF6Mu/vkS2cvixiW66LU+2ffF Z0Q8ep4c1bvTX7Wq5+ZRKw3iQgYR08UCbmnJKlMd6S+qte7biAjuM4uC/E70mYLC5X8MYS3 dRqPBuWQoVRa1hJAuA3iQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:0uFJ5kac5zY=:rQaGZivlwLOLr/GmW3DTl/ oLAptNQ3Auo7Xqmt+ThoXhp5SywL2kPI7yieCYIkgyZHX1yVH6ZMHTk0QTlntqjM2YSWWwdzp NoR4RcGPeqeZ76CXDZpscFmCW9n9D7iNvRIE7XDN2/fiiiwelWKHwwHQPSP0r/y3YeF+b6suP NmixDtYlUBC7FhR5lBylJ6l2+AR4CLsBMvdK/7s8kWwdUfe2ohN9dnTLflEMG7Z5C38yB5OuB YpSYma/BUIeeM9n/piYcAVRSStbJcVy2+nk3sk6NzuJgapcS9Wihe10LYZyX1ncHhZlmYUEGd XVmiCvgD/8XmFWpScwiFBd1LGHfxjl2EGsiDOfP7ocSk+cB66+nLpoFWuAMqDXcBbL/9v1iyn RZXZJSt1UMV1I/51+dXciN1ogL4aXWIEE5akso+V3HRKsVBBCct1gOh0KVCWMUZ+9TZvGxJv1 eJbAt1+7hirgIr7B5ArQ0Ki/dC3RODmt0BSabi0KQa+WJwMEAwcjlJrGkGFipGwme/K0i+mJX eWyF6Qt5Q4xa/dU5ieisLO2RW2+uLwr4kE3h/SyjE+A10fJZYCRrnChZri84r0xVsBE983a7n gjtfvEQvQAH4wtBwnIeALIZQ79WdOH2t9KHkmAAN/CCzJPVhxNpIAvdH+STDDznn4PQ9GgHTo rUBvPC+B7tVSfbdVJnWByBXEEyx9B3XeALxoesSi8cn/vnnSOT3ZoSQewmfUTSouZUorrOE5M Q+uPo115qRgnbWkrwUavjbWgdPWyZpLB4JnIxKkGoR8rHdJz9JyofcpI5lMey9/AT3+mtDQj7 4MyWH9NOVz3sFoM7IZaqMmXCreNJYYgsjf9FJL+vwENiTWS4xVCpkaAa1Dh/QfM+HR2ANwrvo V5kpkt23FKBTyFKBXICg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Raul Kaubi schrieb am 14.10.2020 um 12:22: > Is there a simple way to dynamically get for example parameter > =E2=80=9Eshared buffers=E2=80=9C value (megabytes or gigabytes) to bytes= , for > monitoring perspective..?> > =C2=A0 > > At the moment, this gives me value in GB. > > # psql -U postgres -Atc "show shared_buffers;" > 1GB > > This value may as well be in MB. So I am looking a way to dynamically ge= t the value in bytes. Instead of using "show" you can use a SELECT with pg_size_bytes(): select pg_size_bytes(setting) from pg_settings where name =3D 'shared_buffers';