![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
On Tue, 2 Sep 2003, Tom Lane wrote: "Stacy White" <harsh (AT) computer (DOT) org> writes: to_timestamp appears to pick up the time-of-day from the previous call's return value if a date string has no time component. For example: Weird. I do not see that here, on either 7.3.4 or current sources. Can anyone else reproduce it? For the record, I get: regression=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-01 00:00:00-04 (1 row) regression=# select to_timestamp('2003-06-02 12:13:14', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-02 12:13:14-04 (1 row) regression=# select to_timestamp('2003-06-01', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-01 00:00:00-04 (1 row) I seem to get the incorrect behavior on my 7.4 beta 1 system. The behavior on my machine is really wierd in fact even without times involved: test=# select to_timestamp('2003-06-04', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-04 00:00:00-07 (1 row) test=# select to_timestamp('2003-06', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-04 00:00:00-07 (1 row) test=# select to_timestamp('2003', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-01-01 00:04:00-08 (1 row) test=# select to_timestamp('2003-06', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-06-04 00:00:00-07 (1 row) test=# select to_timestamp('2003-07', 'YYYY-MM-DD HH24:MI:SS') ; to_timestamp ------------------------ 2003-07-04 00:00:00-07 (1 row) |
#2
| |||
| |||
|
|
I don't entirely understand all of what that code is doing, but I think there's something in there that needs to get fixed. |
#3
| |||
| |||
|
|
Replying to myself again: In DCH_processor (formatting.c), it doesn't seem to stop if it's in the middle of processing nodes but runs off the inout string, should the for loop be something like: for (n=node,s=inout;n->type!=NODE_TYPE_END && *s!='\0';++n,++s) { and get rid of the ++s at the bottom of the loop for safety? |
#4
| |||
| |||
|
|
Stephan Szabo <sszabo (AT) megazone (DOT) bigpanda.com> writes: Replying to myself again: In DCH_processor (formatting.c), it doesn't seem to stop if it's in the middle of processing nodes but runs off the inout string, should the for loop be something like: for (n=node,s=inout;n->type!=NODE_TYPE_END && *s!='\0';++n,++s) { and get rid of the ++s at the bottom of the loop for safety? That wouldn't change the behavior, would it? |
#5
| |||
| |||
|
|
Stephan Szabo <sszabo (AT) megazone (DOT) bigpanda.com> writes: I don't entirely understand all of what that code is doing, but I think there's something in there that needs to get fixed. Oh-ho, this is interesting: Build CVS tip on RHL 8.0 with --enable-cassert: no bug. Build CVS tip on RHL 8.0 without --enable-cassert: bug. |
![]() |
| Thread Tools | |
| Display Modes | |
| |