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 masao.fu...@gmail.com 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

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 and...@2ndquadrant.com 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.

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 and...@2ndquadrant.com 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

[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

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 michael.paqu...@gmail.com 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

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 masao.fu...@gmail.com wrote: On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier michael.paqu...@gmail.com 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

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 michael.paqu...@gmail.com wrote: On Wed, Dec 24, 2014 at 10:16 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier michael.paqu...@gmail.com wrote: Wouldn't it be better to declare it as a static

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 masao.fu...@gmail.com 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