Re: pgsql: Move pg_lzcompress.c to src/common.

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Fujii Masao <fujii(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Move pg_lzcompress.c to src/common.
Date: 2014-12-25 14:46:52
Message-ID: CAB7nPqSuMZRMf8fFAo1ZahRXrSTSR=w_uEPTV0kOsa20jUx+oQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Dec 25, 2014 at 10:43 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-12-25 22:39:58 +0900, Fujii Masao wrote:
>> On Thu, Dec 25, 2014 at 8:47 PM, Fujii Masao <fujii(at)postgresql(dot)org> wrote:
>> > Move pg_lzcompress.c to src/common.
>> >
>> > Exposing compression and decompression APIs of pglz makes possible its
>> > use by extensions and contrib modules. pglz_decompress contained a call
>> > to elog to emit an error message in case of corrupted data. This function
>> > is changed to return a status code to let its callers return an error instead.
>> >
>> > This commit is required for upcoming WAL compression feature so that
>> > the WAL reader facility can decompress the WAL data by using pglz_decompress.
>>
>> Hmm... the buildfarm member prairiedog doesn't like this change. Because
>> pg_lzcompress.c uses the macros (like VARSIZE) for varlena datatypes which
>> are defined in postgres.h which client-side should not include. ISTM that
>> pg_lzcompress.c should be changed to be "varlena-free", in order to push it
>> in src/common.
>
> Temporarily this can be solved by including postgres.h the way
> e.g. pg_resetxlog does:
>
> /*
> * We have to use postgres.h not postgres_fe.h here, because there's so much
> * backend-only stuff in the XLOG include files we need. But we need a
> * frontend-ish environment otherwise. Hence this ugly hack.
> */
> #define FRONTEND 1
>
> #include "postgres.h"
Urgh.. Would that mean keeping a local copy of SET_VARSIZE_4B_C and
VARSIZE_4B if this hack is not used? Looking at the git history, I am
seeing similar things in 2008 where pg_crc stuff was moved to src/port
(5c9c08d).
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2014-12-25 16:05:11 Re: pgsql: Move pg_lzcompress.c to src/common.
Previous Message Fujii Masao 2014-12-25 13:53:43 pgsql: Remove duplicate include of slot.h.