I am seeing a compile failure in current CVS from strptime():

  ./backend/access/transam/xlog.c:    if (strptime(tok2, "%Y-%m-%d %H:%M:%S", &tm) == NULL)

BSD/OS does not have that function.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sun, 18 Jul 2004 23:06:33 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
CVS compile failure
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I am seeing a compile failure in current CVS from strptime():
>   ./backend/access/transam/xlog.c:    if (strptime(tok2, "%Y-%m-%d %H:%M:%S", &tm) == NULL)
> BSD/OS does not have that function.

Hmph.  I was wondering if that was really portable or not :-(.
Any ideas about a quick-and-dirty replacement?

Maybe we could call abstimein or something like that.  We just want to
convert a human-readable string value to a time_t, and I can't say that
I thought the strptime behavior was all that friendly anyway...

			regards, tom lane

Mon, 19 Jul 2004 00:14:42 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: CVS compile failure 
On Mon, 19 Jul 2004, Tom Lane wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> I am seeing a compile failure in current CVS from strptime():
>>   ./backend/access/transam/xlog.c:    if (strptime(tok2, "%Y-%m-%d %H:%M:%S", &tm) == NULL)
>> BSD/OS does not have that function.
>
> Hmph.  I was wondering if that was really portable or not :-(.
> Any ideas about a quick-and-dirty replacement?
>
> Maybe we could call abstimein or something like that.  We just want to
> convert a human-readable string value to a time_t, and I can't say that
> I thought the strptime behavior was all that friendly anyway...

Under FreeBSD:

"     The strptime() function does not correctly handle multibyte characters in
      the format argument"

Not sure how critical that is for what you are doing, mind you ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Mon, 19 Jul 2004 02:03:07 -0300 (ADT)
"Marc G. Fournier" <scrappy@postgresql.org>
Re: CVS compile failure 
"Marc G. Fournier" <scrappy@postgresql.org> writes:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> I am seeing a compile failure in current CVS from strptime():
>> ./backend/access/transam/xlog.c:    if (strptime(tok2, "%Y-%m-%d %H:%M:%S", &tm) == NULL)
>> BSD/OS does not have that function.

> Under FreeBSD:
> "     The strptime() function does not correctly handle multibyte characters in
>       the format argument"
> Not sure how critical that is for what you are doing, mind you ...

Not at all, since in this call the format is the fixed constant
"%Y-%m-%d %H:%M:%S".  But it's odd that your BSD variant has strptime()
where Bruce's does not.

I suppose it doesn't much matter though: we have to recode without
strptime.  No big deal.  I'll fix it tomorrow if no one beats me to it.

			regards, tom lane

Mon, 19 Jul 2004 01:10:33 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: CVS compile failure 
On Mon, 19 Jul 2004, Tom Lane wrote:

> "Marc G. Fournier" <scrappy@postgresql.org> writes:
>> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>>> I am seeing a compile failure in current CVS from strptime():
>>> ./backend/access/transam/xlog.c:    if (strptime(tok2, "%Y-%m-%d %H:%M:%S", &tm) == NULL)
>>> BSD/OS does not have that function.
>
>> Under FreeBSD:
>> "     The strptime() function does not correctly handle multibyte characters in
>>       the format argument"
>> Not sure how critical that is for what you are doing, mind you ...
>
> Not at all, since in this call the format is the fixed constant
> "%Y-%m-%d %H:%M:%S".  But it's odd that your BSD variant has strptime()
> where Bruce's does not.

Bruce, how old is your system? :)  If I'm reading the man page right, it 
was introduced on FreeBSD in Jan of '03 ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664

Mon, 19 Jul 2004 10:57:09 -0300 (ADT)
"Marc G. Fournier" <scrappy@postgresql.org>
Re: CVS compile failure 
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I am seeing a compile failure in current CVS from strptime():

Should be fixed now.  I wasn't very happy with strptime() there in
the first place, since it is inflexible about input format and
doesn't support a timezone specification.  Using our own datetime
code works out much better.

			regards, tom lane

Mon, 19 Jul 2004 10:38:04 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: CVS compile failure 