Tom Lane wrote:
After thinking about it I'm inclined to feel that SS and friends should
insist on exactly 2 digits. If you want to allow 1-or-2-digits then use
FMSS, just like the error message tells you. (However, I have a vague
feeling that Oracle doesn't insist on this, and in the end we oug
On Mon, Dec 1, 2008 at 11:08 PM, Heikki Linnakangas
<[EMAIL PROTECTED]> wrote:
> postgres=# SELECT to_timestamp('29-12-2005 01:02:3', 'DD-MM-
> HH24:MI:SS'); -- doesn't work
...
> I think the end of string should be treated like a field separator, colon in
> this example, and we should accept b
> For better or worse, we also allow these more questionable inputs:
Wow. Those are all pretty atrocious.
Even so, it's not clear to me that there's a lot of merit to changing
the behavior. If to_timestamp() isn't rigorous enough, you can always
stick some additional error checking in front of
Robert Haas wrote:
On Mon, Dec 1, 2008 at 10:33 AM, Greg Stark <[EMAIL PROTECTED]> wrote:
How would you parse an input format of just 'SS' ? is there something
ambiguous about '3' ? I don't see anything "bad" about using %d to
output an integer number of seconds.
+1.
It seems to me that it's
"Robert Haas" <[EMAIL PROTECTED]> writes:
> Another point here is that we have always accepted single digits in dates:
Yeah, but that's the general datetime input code, which has rather
different goals than to_timestamp().
After thinking about it I'm inclined to feel that SS and friends should
in
Another point here is that we have always accepted single digits in dates:
portal=> select '2008-11-1'::date;
date
2008-11-01
(1 row)
portal=> select '2008-1-11'::date;
date
2008-01-11
(1 row)
If we're going to handle dates and timestamps inconsistently, there
Greg Stark wrote:
How would you parse an input format of just 'SS' ? is there something
ambiguous about '3' ? I don't see anything "bad" about using %d to
output an integer number of seconds.
The docs say that SS corresponds to "second (00-59)", so clearly it
should expect a two digit ze
On Mon, Dec 1, 2008 at 10:33 AM, Greg Stark <[EMAIL PROTECTED]> wrote:
> How would you parse an input format of just 'SS' ? is there something
> ambiguous about '3' ? I don't see anything "bad" about using %d to
> output an integer number of seconds.
+1.
It seems to me that it's pretty silly to s
How would you parse an input format of just 'SS' ? is there something
ambiguous about '3' ? I don't see anything "bad" about using %d to
output an integer number of seconds.
--
greg
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http:
Dave Page wrote:
On Mon, Dec 1, 2008 at 3:02 PM, David E. Wheeler <[EMAIL PROTECTED]> wrote:
it depends on how you look at it, I suppose. If you look at ":xy" as "x"
being the 10s position and "y" being the 1s position, it makes no sense.
Suffice it to say, I don't look at it that w
On Dec 1, 2008, at 4:09 PM, Dave Page wrote:
On Mon, Dec 1, 2008 at 3:02 PM, David E. Wheeler
<[EMAIL PROTECTED]> wrote:
it depends on how you look at it, I suppose. If you look at ":xy"
as "x"
being the 10s position and "y" being the 1s position, it makes no
sense.
Suffice it to say, I
On Dec 1, 2008, at 4:07 PM, Alvaro Herrera wrote:
David E. Wheeler wrote:
Oh, well yeah, it should be consistent. But I'm still not sure
that :3
should be allowed. OTOH, who does that, anyway?
Anyone who prints times as %d:%d:%d. You can find those in the wild.
I guess I should have exp
On Mon, Dec 1, 2008 at 3:02 PM, David E. Wheeler <[EMAIL PROTECTED]> wrote:
> it depends on how you look at it, I suppose. If you look at ":xy" as "x"
> being the 10s position and "y" being the 1s position, it makes no sense.
Suffice it to say, I don't look at it that way :-). I'd wager most
peop
David E. Wheeler wrote:
> Oh, well yeah, it should be consistent. But I'm still not sure that :3
> should be allowed. OTOH, who does that, anyway?
Anyone who prints times as %d:%d:%d. You can find those in the wild.
--
Alvaro Herrerahttp://www.CommandPrompt.co
On Dec 1, 2008, at 3:55 PM, Dave Page wrote:
I'm generally in favor of being generous in the input one can
accept, but in
this case it seems ambiguous to me. Is that supposed to be :30 or :
03?
There's no way to tell.
How is it ambiguous? The leading zero is technically redundant. A
trailin
On Dec 1, 2008, at 3:52 PM, Tom Lane wrote:
I'm generally in favor of being generous in the input one can accept,
but in this case it seems ambiguous to me. Is that supposed to be :30
or :03? There's no way to tell.
But notice that we are allowing a single digit for the hour and minute
fields.
On Mon, Dec 1, 2008 at 2:45 PM, David E. Wheeler <[EMAIL PROTECTED]> wrote:
> On Dec 1, 2008, at 1:08 PM, Heikki Linnakangas wrote:
>
>> postgres=# SELECT to_timestamp('29-12-2005 01:02:3', 'DD-MM-
>> HH24:MI:SS'); -- doesn't work
>> ERROR: source string too short for "SS" formatting field
>>
"David E. Wheeler" <[EMAIL PROTECTED]> writes:
> On Dec 1, 2008, at 1:08 PM, Heikki Linnakangas wrote:
>> I think the end of string should be treated like a field separator,
>> colon in this example, and we should accept both of the above.
>> Opinions?
> I'm generally in favor of being generou
On Dec 1, 2008, at 1:08 PM, Heikki Linnakangas wrote:
postgres=# SELECT to_timestamp('29-12-2005 01:02:3', 'DD-MM-
HH24:MI:SS'); -- doesn't work
ERROR: source string too short for "SS" formatting field
DETAIL: Field requires 2 characters, but only 1 remain.
HINT: If your source string i
I like strict in general, but this doesn't seem logical:
postgres=# SELECT to_timestamp('29-12-2005 01:2:03', 'DD-MM-
HH24:MI:SS'); -- works
to_timestamp
2005-12-29 01:02:03+02
(1 row)
postgres=# SELECT to_timestamp('29-12-2005 01:02:3', 'DD-MM-
HH24:MI
20 matches
Mail list logo