Re: BUG #14322: Possible inconsistent behavior with timestamp_to_str()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Keith Fiske <keith(at)omniti(dot)com>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, Keith <keith(at)keithf4(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14322: Possible inconsistent behavior with timestamp_to_str()
Date: 2016-09-13 21:21:38
Message-ID: 17047.1473801698@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Keith Fiske <keith(at)omniti(dot)com> writes:
> On Tue, Sep 13, 2016 at 5:03 PM, Marko Tiikkaja <marko(at)joh(dot)to> wrote:
>> Did you miss this part?
>> /* [ ... ] Note
>> * also that the result is in a static buffer, not pstrdup'd.

Oh, duh.

> Yeah I did see that when i went to look at its source and wondered if that
> may be why, but I'm still fairly new to C and wasn't sure that was the
> reason.
> Still think it would be nice to use it in a more flexible manner.

You can pstrdup its result if you want. If it did that internally
it would result in some memory leaks we didn't want, IIRC.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andreas Papst 2016-09-14 07:12:14 Re: BUG #14320: systemd terminates postgresql hot standby instance 90 seconds after start
Previous Message Keith Fiske 2016-09-13 21:06:16 Re: BUG #14322: Possible inconsistent behavior with timestamp_to_str()