Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YfB5t-0000i3-Cz for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Apr 2015 17:45:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YfB5s-0002oU-FF for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Apr 2015 17:45:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YfB5q-0002oL-5w for pgsql-bugs@postgresql.org; Mon, 06 Apr 2015 17:45:50 +0000 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YfB5i-00074p-LX for pgsql-bugs@postgresql.org; Mon, 06 Apr 2015 17:45:48 +0000 Received: by igblo3 with SMTP id lo3so25249892igb.0 for ; Mon, 06 Apr 2015 10:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xanuMnjf8GdL1uwgzJ5a0IThD+XVC7LA0foNDpbRKbI=; b=gqEc5L9KwDtj9sljTzx0pQx5dqh7ruZhchDd3Zvc6Ie61XLFGKx89tPXd2/hw1wISA mac5khHAnoy9IEiWzpnmeDldHEHFdq+qkVXQYM7U643MYU9ZTrcOt093a0ITgA3tDKnE b/6AwGvXUeK0Y56nt0MSoI8vEGRA6QnDDVwKsv2H1DhIg85f/iJc+5Y/Duj4c/PSz+Bd 0J2ahiUNNsR8SdmP7e/0q17LqmXNrtbNgfIdreGjeUa0Ph32LJZW00hXoiZj+wLhia86 F0p7rkTy6nx0wU8pRkuiG8KRNepIuvSAiGUs6GYjsNMf1o/Wyq7Aalw8EvuVi/Qj7cnF hyTQ== MIME-Version: 1.0 X-Received: by 10.42.88.206 with SMTP id d14mr21016926icm.40.1428342341686; Mon, 06 Apr 2015 10:45:41 -0700 (PDT) Received: by 10.36.78.80 with HTTP; Mon, 6 Apr 2015 10:45:41 -0700 (PDT) In-Reply-To: <20150406173026.2550.39773@wrigleys.postgresql.org> References: <20150406173026.2550.39773@wrigleys.postgresql.org> Date: Mon, 6 Apr 2015 10:45:41 -0700 Message-ID: Subject: Re: BUG #12989: pg_size_pretty with negative values From: "David G. Johnston" To: cbalmeida@gmail.com Cc: "pgsql-bugs@postgresql.org" Content-Type: multipart/alternative; boundary=90e6ba3fcb83e4d9ef051311dd51 X-Pg-Spam-Score: -1.7 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --90e6ba3fcb83e4d9ef051311dd51 Content-Type: text/plain; charset=UTF-8 On Mon, Apr 6, 2015 at 10:30 AM, wrote: > The following bug has been logged on the website: > > Bug reference: 12989 > Logged by: Christian Almeida > Email address: cbalmeida@gmail.com > PostgreSQL version: 9.3.6 > Operating system: Ubuntu 14.04 LTS > Description: > > The function "pg_size_pretty" is not formatting negative numbers. > > > Example: > select pg_size_pretty(+123456789::bigint), > pg_size_pretty(-123456789::bigint) > > Output: > ---------------------------- > 118 MB -123456789 bytes > > Do you want the result to be "-118 MB" or "ERROR: invalid input - size cannot be negative (-123456789)"? David J. --90e6ba3fcb83e4d9ef051311dd51 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Ap= r 6, 2015 at 10:30 AM, <c= balmeida@gmail.com> wrote:
The following bug has been logged on t= he website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 12989
Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Christian Almeida
Email address:=C2=A0 =C2=A0 =C2=A0 c= balmeida@gmail.com
PostgreSQL version: 9.3.6
Operating system:=C2=A0 =C2=A0Ubuntu 14.04 LTS
Description:

The function "pg_size_pretty" is not formatting negative numbers.=


Example:
select pg_size_pretty(+123456789::bigint),
pg_size_pretty(-123456789::bigint)

Output:
----------------------------
118 MB=C2=A0 =C2=A0 =C2=A0 -123456789 bytes


Do you want the result to be "= ;-118 MB" or "ERROR: invalid input - size cannot be negative (-12= 3456789)"?

David J.
--90e6ba3fcb83e4d9ef051311dd51--