Move pg_lzcompress.c to src/common.
authorFujii Masao <fujii@postgresql.org>
Mon, 9 Feb 2015 06:15:24 +0000 (15:15 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 9 Feb 2015 06:15:24 +0000 (15:15 +0900)
commit40bede5477bb5bce98ce9548841cb414634c26f7
tree5d60712a6fb180b315d4e66f599ad9a90e10a344
parent237795a7b4ccf359423bdd99476782d4880eda83
Move pg_lzcompress.c to src/common.

The meta data of PGLZ symbolized by PGLZ_Header is removed, to make
the compression and decompression code independent on the backend-only
varlena facility. PGLZ_Header is being used to store some meta data
related to the data being compressed like the raw length of the uncompressed
record or some varlena-related data, making it unpluggable once PGLZ is
stored in src/common as it contains some backend-only code paths with
the management of varlena structures. The APIs of PGLZ are reworked
at the same time to do only compression and decompression of buffers
without the meta-data layer, simplifying its use for a more general usage.

On-disk format is preserved as well, so there is no incompatibility with
previous major versions of PostgreSQL for TOAST entries.

Exposing compression and decompression APIs of pglz makes possible its
use by extensions and contrib modules. Especially this commit is required
for upcoming WAL compression feature so that the WAL reader facility can
decompress the WAL data by using pglz_decompress.

Michael Paquier, reviewed by me.
src/backend/access/heap/tuptoaster.c
src/backend/utils/adt/Makefile
src/common/Makefile
src/common/pg_lzcompress.c [moved from src/backend/utils/adt/pg_lzcompress.c with 92% similarity]
src/include/common/pg_lzcompress.h [moved from src/include/utils/pg_lzcompress.h with 77% similarity]
src/tools/msvc/Mkvcbuild.pm
src/tools/pgindent/typedefs.list