Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-26 Thread Tom Lane
Brendan Jurd dire...@gmail.com writes: A quick grep through the backend code shows that strlcpy and strncpy are both in use, with neither having a clear majority. I used strncpy because it is more prevalent within src/backend/utils/adt. strncpy is generally deprecated; any remaining uses you

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-19 Thread Brendan Jurd
On Sat, Sep 27, 2008 at 4:25 AM, Brendan Jurd dire...@gmail.com wrote: One way to tidy this up would be to re-implement the meridiem markers using the seq_search functions, i.e., make it work like the day and month names. This would make it easy to accept any flavour of marker, and the error

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-18 Thread Brendan Jurd
On Sat, Sep 27, 2008 at 4:25 AM, Brendan Jurd dire...@gmail.com wrote: Currently, Postgres accepts four separate flavours for specifying meridiem markers, given by uppercase/lowercase and with/without periods: * am/pm * AM/PM * a.m./p.m. * A.M./P.M. I would go so far as to say that

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-07 Thread Bruce Momjian
Brendan Jurd wrote: On Thu, Jan 8, 2009 at 2:10 PM, Bruce Momjian br...@momjian.us wrote: Brendan, did you ever complete this patch? I didn't, no. I still intend on doing work in this area, but obviously it will have to be in the 8.5 cycle. OK, what is the TODO? It is more than AM/PM,

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-07 Thread Brendan Jurd
On Thu, Jan 8, 2009 at 2:10 PM, Bruce Momjian br...@momjian.us wrote: Brendan, did you ever complete this patch? I didn't, no. I still intend on doing work in this area, but obviously it will have to be in the 8.5 cycle. Cheers, BJ -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-07 Thread Bruce Momjian
Brendan Jurd wrote: On Sat, Sep 27, 2008 at 4:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Alex Hunsaker bada...@gmail.com writes: However that still leaves the original complaint around (at least IMHO): select to_timestamp('AN', 'AM'); ERROR: invalid AM/PM string select

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2009-01-07 Thread Brendan Jurd
On Thu, Jan 8, 2009 at 2:20 PM, Bruce Momjian br...@momjian.us wrote: OK, what is the TODO? It is more than AM/PM, right? I see it happening in two stages. Stage 1 is updating the AM/PM parse code to use the seq_search technique, which may involve some minor refactoring around seq_search

[HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2008-09-26 Thread Brendan Jurd
Hey folks, Tom pointed out in the parent thread [1] that the error message for bogus AM/PM markers in to_timestamp is pretty lame: ERROR: invalid AM/PM string I agree, and once I started thinking about this, I came up with other gripes concerning the treatment of 12-hour time in

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2008-09-26 Thread Tom Lane
Brendan Jurd [EMAIL PROTECTED] writes: One way to tidy this up would be to re-implement the meridiem markers using the seq_search functions, i.e., make it work like the day and month names. This would make it easy to accept any flavour of marker, and the error messages thrown for bogus input

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2008-09-26 Thread Alex Hunsaker
On Fri, Sep 26, 2008 at 11:25 AM, Brendan Jurd [EMAIL PROTECTED] wrote: One way to tidy this up would be to re-implement the meridiem markers using the seq_search functions, i.e., make it work like the day and month names. This would make it easy to accept any flavour of marker, and the error

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2008-09-26 Thread Tom Lane
Alex Hunsaker [EMAIL PROTECTED] writes: However that still leaves the original complaint around (at least IMHO): select to_timestamp('AN', 'AM'); ERROR: invalid AM/PM string select to_timestamp('11:47 PM 27 Sep a2008', 'HH:MI PM DD Mon '); ERROR: invalid value for in source string

Re: [HACKERS] Meridiem markers (was: [BUGS] Incorrect invalid AM/PM string error from to_timestamp)

2008-09-26 Thread Brendan Jurd
On Sat, Sep 27, 2008 at 4:08 AM, Tom Lane [EMAIL PROTECTED] wrote: Alex Hunsaker [EMAIL PROTECTED] writes: However that still leaves the original complaint around (at least IMHO): select to_timestamp('AN', 'AM'); ERROR: invalid AM/PM string select to_timestamp('11:47 PM 27 Sep a2008',