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 1kSiWy-0003h4-0J for pgsql-general@arkaria.postgresql.org; Wed, 14 Oct 2020 15:17:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kSiWw-0003aW-Tq for pgsql-general@arkaria.postgresql.org; Wed, 14 Oct 2020 15:17:30 +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 1kSiWw-0003aP-Mh for pgsql-general@lists.postgresql.org; Wed, 14 Oct 2020 15:17:30 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:510a::3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSiWu-0000nt-BN for pgsql-general@lists.postgresql.org; Wed, 14 Oct 2020 15:17:30 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "Christoph Moench-Tegeder" (verified OK)) by smtp.burggraben.net (Postfix) with ESMTPS id EC3E5C0031C; Wed, 14 Oct 2020 17:17:26 +0200 (CEST) Received: by elch.exwg.net (Postfix, from userid 1000) id 71FBA13987A; Wed, 14 Oct 2020 17:17:26 +0200 (CEST) Date: Wed, 14 Oct 2020 17:17:26 +0200 From: Christoph Moench-Tegeder To: Magnus Hagander Cc: Thomas Kellerer , pgsql-general Subject: Re: Parameter value from (mb/gb) to bytes Message-ID: <20201014151726.GA50753@elch.exwg.net> References: <6cbca2bcda734464a1be9f7d7380ff33@rik.ee> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.7 (2020-08-29) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ## Magnus Hagander (magnus@hagander.net): > Actually, it doesn't have to be in 8k pages, that depends on the build > options. So if you want to be perfectly correct, you should probably > multiply with current_setting('block_size') instead of a hardcoded 8192 :) More self-contained: select pg_size_bytes(setting) * pg_size_bytes(unit) from pg_settings where name = 'shared_buffers'; I guess that's what that unit column is there for. Regards, Christoph -- Spare Space