Re: No, pg_size_pretty(numeric) was not such a hot idea

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: No, pg_size_pretty(numeric) was not such a hot idea
Date: 2012-05-26 04:45:35
Message-ID: CAHGQGwHyTXYJp8CnzupOu_J=J4scDpaqez_SWxyNAfextks8PQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 26, 2012 at 9:30 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> In 9.1:
>
> regression=# select pg_size_pretty(8*1024*1024);
>  pg_size_pretty
> ----------------
>  8192 kB
> (1 row)
>
> In HEAD:
>
> regression=# select pg_size_pretty(8*1024*1024);
> ERROR:  function pg_size_pretty(integer) is not unique
> LINE 1: select pg_size_pretty(8*1024*1024);
>               ^
> HINT:  Could not choose a best candidate function. You might need to add explicit type casts.
>
> The argument for adding pg_size_pretty(numeric) was pretty darn thin in
> the first place, IMHO; it does not seem to me that it justified this
> loss of usability.

Ouch! But removing pg_size_pretty(numeric) causes another usability
issue, e.g., pg_size_pretty(pg_xlog_location_diff(...)) fails. So how about
removing pg_size_pretty(bigint) to resolve those two issues?
I guess pg_size_pretty(numeric) is a bit slower than bigint version, but
I don't think that such a bit slowdown of pg_size_pretty() becomes
a matter practically. No?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2012-05-26 09:21:34 FailedAssertion("!(PrivateRefCount[i] == 0)", File: "bufmgr.c", Line: 1741
Previous Message Tom Lane 2012-05-26 04:18:54 Re: Per-Database Roles