Re: Reasons not to like asprintf

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reasons not to like asprintf
Date: 2013-10-24 20:53:17
Message-ID: CA+TgmoY2ZkAjke8v4mF-Hf+T1yhnntsTbhiNP4Bs-vqGEFUSdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 24, 2013 at 2:18 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On 10/22/13, 3:40 PM, Tom Lane wrote:
>> In order to avoid having to clutter stuff like that with #ifdef FRONTENDs,
>> I'm now thinking we should use exactly the same names for the frontend and
>> backend versions, ie psprintf() and pvsprintf(). The main reason for
>> considering a pg_ prefix for the frontend versions was to avoid cluttering
>> application namespace; but it's already the case that we don't expect
>> libpgcommon to be namespace clean.
>
> While this is attractive, the same logic would suggest that we rename
> pg_malloc() to palloc(), and that sounds wrong. The frontend and
> backend functions do have different freeing semantics.

I'd almost be inclined to go the other way and suggest that we try to
use the pg_ prefix more, at least for things to be shared between
front and back end code.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2013-10-24 20:57:29 Re: Patch for fail-back without fresh backup
Previous Message Josh Berkus 2013-10-24 20:51:52 Re: Patch for fail-back without fresh backup