Re: custom function for converting human readable sizes to bytes - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: custom function for converting human readable sizes to bytes
Date
Msg-id CAFj8pRD7OdyHrqXEkykE11BeHARhs5T+ddQ98+NwW-UokUNpQw@mail.gmail.com
Whole thread Raw
In response to Re: custom function for converting human readable sizes to bytes  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers


2016-01-04 16:51 GMT+01:00 Robert Haas <robertmhaas@gmail.com>:
On Mon, Jan 4, 2016 at 10:17 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> [ new patch ]

+         case '-':
+             ereport(ERROR,
+                     (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+                      errmsg("size cannot be negative")));

Why not?  I bet if you copy any - sign to the buffer, this will Just Work.

true, fixed
 

+         if ( conv->base_unit == GUC_UNIT_KB &&

Whitespace.

I don't see it ??

Regards

Pavel
 

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Some 9.5beta2 backend processes not terminating properly?
Next
From: Thom Brown
Date:
Subject: Re: custom function for converting human readable sizes to bytes