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

2009-02-07 Thread Bruce Momjian
Brendan Jurd wrote: > On Tue, Jan 27, 2009 at 3:25 PM, Brendan Jurd wrote: > > On Tue, Jan 27, 2009 at 3:05 PM, Tom Lane wrote: > >> > >> strncpy is generally deprecated; any remaining uses you find of it > >> are probably only there for lack of round tuits. Use strlcpy in new > >> code, unless

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

2009-01-26 Thread Brendan Jurd
On Tue, Jan 27, 2009 at 3:25 PM, Brendan Jurd wrote: > On Tue, Jan 27, 2009 at 3:05 PM, Tom Lane wrote: >> >> strncpy is generally deprecated; any remaining uses you find of it >> are probably only there for lack of round tuits. Use strlcpy in new >> code, unless there's a pretty strong argument

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

2009-01-26 Thread Brendan Jurd
On Tue, Jan 27, 2009 at 3:05 PM, Tom Lane wrote: > Brendan Jurd 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 ge

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

2009-01-26 Thread Brendan Jurd
On Mon, Jan 26, 2009 at 8:32 AM, Alex Hunsaker wrote: > > -the various (only moved not added) > strncpy(...) > copy[len] = '\0'; > > just use strlcpy? > Thanks for having a look Alex. strlcpy would be easier, but I thought there might be portability concerns re its non-entirely-standard status.

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

2009-01-25 Thread Alex Hunsaker
On Mon, Jan 19, 2009 at 15:26, Brendan Jurd wrote: > From the better-late-than-never department, comes a patch to improve > the handling of AM/PM and AD/BC markers in to_timestamp(), and up the > ante on error reporting for various kinds of invalid input. Ok cool I tried this out and gave it a lo