Re: proposal: rounding up time value less than its unit.

From: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Smith <gregsmithpgsql(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: rounding up time value less than its unit.
Date: 2014-09-26 23:00:16
Message-ID: CAKFQuwbxfE7ZAT_cLuSGiCb3ZdVf0D6YZJa0gXMwj-m3d3GDzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, September 26, 2014, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> David Johnston wrote:
> > On Friday, September 26, 2014, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com
> <javascript:;>>
> > wrote:
> >
> > > Tom Lane wrote:
> > >
> > > > The impression I had was that Stephen was thinking of actually
> setting
> > > > min_val to 1 (or whatever) and handling zero or -1 in some
> out-of-band
> > > > fashion, perhaps by adding GUC flag bits showing those as allowable
> > > > special cases. I'm not sure how we would display such a state of
> affairs
> > > > in pg_settings, but other than that it doesn't sound implausible.
> > >
> > > I would think that if we're going to have "out of band" values, we
> > > should just use "off", not 0 or -1.
> >
> > Except "off" is not always semantically correct - some GUCs (not sure
> which
> > ones ATM) use zero to mean 'default'. I think -1 always means off.
> > Instead of 0 and -1 we'd need 'default' and 'off' with the ability to
> error
> > if there is no meaningful default defined or if a feature cannot be
> turned
> > off.
>
> Sure, "off" (and other spellings of boolean false value) and "default"
> where they make sense, and whatever other values that make sense. My
> point is to avoid collapsing such logical values to integer/floating
> point values just because the option uses a numeric scale.
>
>
My comment was more about storage than data entry. I'm not sure, though,
that we'd want to allow 0 as valid input even if it is acceptable for
Boolean.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-09-26 23:19:33 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Previous Message Gregory Smith 2014-09-26 22:55:44 Re: proposal: rounding up time value less than its unit.