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

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: proposal: rounding up time value less than its unit.
Дата
Msg-id CA+TgmoYpxAWWDzQw5dEXUf=2V3Geu6Nf2ZJS91HOmHy+Vdw3Tw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: rounding up time value less than its unit.  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: proposal: rounding up time value less than its unit.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Sep 26, 2014 at 10:58 AM, Stephen Frost <sfrost@snowman.net> wrote:
> * Robert Haas (robertmhaas@gmail.com) wrote:
>> On Thu, Sep 25, 2014 at 4:49 PM, Stephen Frost <sfrost@snowman.net> wrote:
>> > * Gregory Smith (gregsmithpgsql@gmail.com) wrote:
>> >> On 9/25/14, 2:02 PM, Peter Eisentraut wrote:
>> >> >But having the same parameter setting mean different things in
>> >> >different versions is the path to complete madness.
>> >>
>> >> Could we go so far as to remove support for unitless time settings
>> >> eventually?  The fact that people are setting raw numbers in the
>> >> configuration file and have to know the unit to understand what they
>> >> just did has never been something I like.
>> >
>> > I could certainly get behind that idea...  Tho I do understand that
>> > people will complain about backwards compatibility, etc, etc.
>>
>> There's also the fact that it doesn't fix the originally complained-of
>> problem.  It does fix a problem with one of the fixes proposed for
>> that original problem, though.
>
> That's certainly an excellent point- this is really orthogonal to the
> actual issue of setting a value smaller than a single unit for that
> setting.  Even if you have units attached to every GUC, an individual
> could take a setting which is understaood at the '1 minute' level and
> attempt to set it to '30 seconds', for example.
>
> On the other hand, if we're making it an error to set values without
> units, I'd again be behind the idea of throwing an error on the
> smaller-than-one-unit case- people are going to have to go update their
> configurations to deal with the errors from the lack-of-units, this
> would just be another item to fix during that process.  It'd certainly
> be worse to change to require units and then wait anothe release to fix
> or change things to address the original complaint.

Yep, I'll buy that.

If we want the narrowest possible fix for this, I think it's "complain
if a non-zero value would round to zero".  That fixes the original
complaint and changes absolutely nothing else.  But I think that's
kind of wussy.  Yeah, rounding 29 seconds down to a special magic
value of 0 is more surprising than rounding 30 seconds up to a minute,
but the latter is still surprising.  We're generally not averse to
tighter validation, so why here?  We're not talking about preventing
the use of 60s to mean 1min, just the use of 42s to mean 1min, which
is no different than not letting 2/29/93 mean 3/1/93, a decision about
which we have no compunctions.

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: WITH CHECK and Column-Level Privileges
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: WITH CHECK and Column-Level Privileges