Re: Interval input: usec, msec - Mailing list pgsql-patches

From Neil Conway
Subject Re: Interval input: usec, msec
Date
Msg-id 1180415202.6648.65.camel@goldbach
Whole thread Raw
In response to Re: Interval input: usec, msec  (Neil Conway <neilc@samurai.com>)
Responses Re: Interval input: usec, msec
List pgsql-patches
On Mon, 2007-28-05 at 13:54 -0400, Neil Conway wrote:
> Okay, attached is a patch that does this. To summarize, the changes are:
>
>    * add tmask bits for msec, usec (I reordered the #defines to keep
>      them logically contiguous, but AFAICS this isn't necessary)
>    * if the user specifies multiple instances of usec, msec, or sec,
>      reject as invalid input
>    * if the user specifies a fractional second ("5.5 seconds"), also
>      consider that to be millisecond and microsecond input from the
>      POV of rejecting duplicate units. So "5.5 seconds 1 millisecond"
>      will be rejected.

Applied to HEAD, backported to 8.2 and 8.1

After I applied the patches, it occurred to me that this patch actually
slightly changes previous behavior: the previous coding accepted inputs
like "1 microsecond 1 microsecond 1 second", whereas the patch rejects
this input. I don't think this is a major problem (input of this kind is
likely a client bug), but I figured I'd mention it...

-Neil



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Interval input: usec, msec
Next
From: Michael Glaesemann
Date:
Subject: Re: Interval input: usec, msec