Re: WAL format and API changes (9.5) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: WAL format and API changes (9.5)
Date
Msg-id 20140812145521.GE5728@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: WAL format and API changes (9.5)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Heikki Linnakangas wrote:
> On 08/05/2014 03:50 PM, Michael Paquier wrote:

> >- XLogRecGetBlockRefIds needing an already-allocated array for *out is not
> >user-friendly. Cannot we just do all the work inside this function?
> 
> I agree it's not a nice API. Returning a palloc'd array would be
> nicer, but this needs to work outside the backend too (e.g.
> pg_xlogdump). It could return a malloc'd array in frontend code, but
> it's not as nice. On the whole, do you think that be better than the
> current approach?

I don't see the issue.  Right now, in frontend code you can call
palloc() and pfree(), and they behave like malloc() and free() (see
fe_memutils.c).  Your module doesn't need to do anything special.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: WAL format and API changes (9.5)
Next
From: Robert Haas
Date:
Subject: Re: jsonb format is pessimal for toast compression