Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-25 Thread Andres Freund
On 2014-12-25 21:12:54 +0900, Michael Paquier wrote: > On Thu, Dec 25, 2014 at 7:48 PM, Andres Freund wrote: > > I think it's a bad idea to move it away - the current placement provides > > a API that allows to get at the image data without having to deal with > > the low level details. E.g. the i

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-25 Thread Michael Paquier
On Thu, Dec 25, 2014 at 7:48 PM, Andres Freund wrote: > I think it's a bad idea to move it away - the current placement provides > a API that allows to get at the image data without having to deal with > the low level details. E.g. the in_use, has_image and hole > logic. *Especially* when we add c

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-25 Thread Andres Freund
On 2014-12-25 08:52:05 +0900, Michael Paquier wrote: > On Wed, Dec 24, 2014 at 10:51 PM, Fujii Masao wrote: > > Fair enough. Anyway I wait for applying the patch which moves > > pg_lzcompress.c > > until we will have reached any consensus about this. > Just to be clear (after sleeping on it), we

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-24 Thread Michael Paquier
On Wed, Dec 24, 2014 at 10:51 PM, Fujii Masao wrote: > Fair enough. Anyway I wait for applying the patch which moves pg_lzcompress.c > until we will have reached any consensus about this. Just to be clear (after sleeping on it), we still need pglz stuff in src/common to offer to the frontends the

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-24 Thread Fujii Masao
On Wed, Dec 24, 2014 at 10:41 PM, Michael Paquier wrote: > On Wed, Dec 24, 2014 at 10:16 PM, Fujii Masao wrote: >> On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier >> wrote: >>> Wouldn't it be better to declare it as a static routine in >>> xlogutils.c? If we keep it in xlogreader.c, I think tha

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-24 Thread Michael Paquier
On Wed, Dec 24, 2014 at 10:16 PM, Fujii Masao wrote: > On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier > wrote: >> Wouldn't it be better to declare it as a static routine in >> xlogutils.c? If we keep it in xlogreader.c, I think that we should at >> least wrap it with ifndef FRONTEND. > > If we

Re: [HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-24 Thread Fujii Masao
On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier wrote: > Hi all, > > Commit 2c03216d has introduced RestoreBlockImage to restore a page > from a given decoding state. ISTM that this is a backend-only > operation but it has been added in xlogreader.c which could be used as > well by frontend utili

[HACKERS] Moving RestoreBlockImage from xlogreader.c to xlogutils.c

2014-12-24 Thread Michael Paquier
Hi all, Commit 2c03216d has introduced RestoreBlockImage to restore a page from a given decoding state. ISTM that this is a backend-only operation but it has been added in xlogreader.c which could be used as well by frontend utilities like pg_xlogdump. Wouldn't it be better to declare it as a stat