Re: Parameter value from (mb/gb) to bytes

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Parameter value from (mb/gb) to bytes
Дата
Msg-id f95d954f-6467-a50a-f8fc-8bf4bb80e902@gmx.net
обсуждение исходный текст
Ответ на Parameter value from (mb/gb) to bytes  (Raul Kaubi <Raul.Kaubi@rik.ee>)
Ответы Re: Parameter value from (mb/gb) to bytes  (Thomas Kellerer <shammat@gmx.net>)
Список pgsql-general
Raul Kaubi schrieb am 14.10.2020 um 12:22:
> Is there a simple way to dynamically get for example parameter
> „shared buffers“ value (megabytes or gigabytes) to bytes, for
> monitoring perspective..?>
>  
>
> 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 get 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 = 'shared_buffers';








В списке pgsql-general по дате отправления:

Предыдущее
От: Paul Förster
Дата:
Сообщение: Re: What's your experience with using Postgres in IoT-contexts?
Следующее
От: Thomas Kellerer
Дата:
Сообщение: Re: Parameter value from (mb/gb) to bytes