Re: pgsql: Add pg_size_bytes() to parse human-readable size strings.

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add pg_size_bytes() to parse human-readable size strings.
Date: 2016-02-20 14:04:38
Message-ID: CAFj8pRCz9quQjMNOcdUByEEj9hK1u5zSx6W=MgNcojYMseKoLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

2016-02-20 11:07 GMT+01:00 Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>:

> Add pg_size_bytes() to parse human-readable size strings.
>
> This will parse strings in the format produced by pg_size_pretty() and
> return sizes in bytes. This allows queries to be written with clauses
> like "pg_total_relation_size(oid) > pg_size_bytes('10 GB')".
>
> Author: Pavel Stehule with various improvements by Vitaly Burovoy
> Discussion:
> http://www.postgresql.org/message-id/CAFj8pRD-tGoDKnxdYgECzA4On01_uRqPrwF-8LdkSE-6bDHp0w@mail.gmail.com
> Reviewed-by: Vitaly Burovoy, Oleksandr Shulgin, Kyotaro Horiguchi,
> Michael Paquier and Robert Haas
>
> Branch
> ------
> master
>
> Details
> -------
>
> http://git.postgresql.org/pg/commitdiff/53874c5228fe16589a4d01b3e1fab3678e0fd8e3
>
> Modified Files
> --------------
> doc/src/sgml/func.sgml | 32 +++++++-
> src/backend/utils/adt/dbsize.c | 149
> +++++++++++++++++++++++++++++++++++
> src/include/catalog/catversion.h | 2 +-
> src/include/catalog/pg_proc.h | 2 +
> src/include/utils/builtins.h | 1 +
> src/test/regress/expected/dbsize.out | 109 +++++++++++++++++++++++++
> src/test/regress/sql/dbsize.sql | 39 +++++++++
> 7 files changed, 331 insertions(+), 3 deletions(-)
>

great :)

Thank you very much

Regards

Pavel

>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-02-20 14:54:07 Re: pgsql: Fix pg_size_bytes() to be more portable.
Previous Message Dean Rasheed 2016-02-20 11:11:43 pgsql: Fix pg_size_bytes() to be more portable.