pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Keith Fiske <keith@omniti.com>
Cc: Marko Tiikkaja <marko@joh.to>
Cc: Keith <keith@keithf4.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14322: Possible inconsistent behavior with timestamp_to_str()
Date: Tue, 13 Sep 2016 17:21:38 -0400
Message-ID: <17047.1473801698@sss.pgh.pa.us> (raw)
In-Reply-To: <CAG1_KcCkcUYaZmNz6ot9GJrtYNur0KOz7QhiUF6FZDC16XZ9+w@mail.gmail.com>
References: <20160909235448.20021.79001@wrigleys.postgresql.org>
	<20160910000204.mbbfdxtw4t4oelzs@alap3.anarazel.de>
	<CAHw75vuZZSY_d+cH8WEBU6weKLQynHWx+a7WT4t-S9d8_1dk3g@mail.gmail.com>
	<CAG1_KcAHNz=-okj-SzxYEwWJYUv23otFrdBVm8CbYvhzn7Wi6A@mail.gmail.com>
	<28770.1473799942@sss.pgh.pa.us>
	<CAG1_KcA-RuEWO6BmmfXVGLj66ig437Cj2c8nc0UpwrhEL5PxHQ@mail.gmail.com>
	<08129d47-7952-dff2-e9e9-8a1b2bf706bd@joh.to>
	<CAG1_KcCkcUYaZmNz6ot9GJrtYNur0KOz7QhiUF6FZDC16XZ9+w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Keith Fiske <keith@omniti.com> writes:
> On Tue, Sep 13, 2016 at 5:03 PM, Marko Tiikkaja <marko@joh.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (10+ messages)

Message-ID: <17047.1473801698@sss.pgh.pa.us>
Permalink:  ../17047.1473801698@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17047.1473801698@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, keith@omniti.com, marko@joh.to, keith@keithf4.com, andres@anarazel.de
  Subject: Re: BUG #14322: Possible inconsistent behavior with timestamp_to_str()
  In-Reply-To: <17047.1473801698@sss.pgh.pa.us>
  References: <20160909235448.20021.79001@wrigleys.postgresql.org> <20160910000204.mbbfdxtw4t4oelzs@alap3.anarazel.de> <CAHw75vuZZSY_d+cH8WEBU6weKLQynHWx+a7WT4t-S9d8_1dk3g@mail.gmail.com> <CAG1_KcAHNz=-okj-SzxYEwWJYUv23otFrdBVm8CbYvhzn7Wi6A@mail.gmail.com> <28770.1473799942@sss.pgh.pa.us> <CAG1_KcA-RuEWO6BmmfXVGLj66ig437Cj2c8nc0UpwrhEL5PxHQ@mail.gmail.com> <08129d47-7952-dff2-e9e9-8a1b2bf706bd@joh.to> <CAG1_KcCkcUYaZmNz6ot9GJrtYNur0KOz7QhiUF6FZDC16XZ9+w@mail.gmail.com> <17047.1473801698@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox