2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, postgresql, openssl, zlib, readline }:
|
2016-09-21 17:39:57 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "pg_repack";
|
2022-10-14 04:20:00 +00:00
|
|
|
version = "1.4.8";
|
2016-09-21 17:39:57 +00:00
|
|
|
|
2018-11-04 00:46:05 +00:00
|
|
|
buildInputs = [ postgresql openssl zlib readline ];
|
2016-09-21 17:39:57 +00:00
|
|
|
|
2018-11-04 00:46:05 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "reorg";
|
|
|
|
repo = "pg_repack";
|
2022-11-18 04:20:00 +00:00
|
|
|
rev = "ver_${version}";
|
|
|
|
sha256 = "sha256-Et8aMRzG7ez0uy9wG6qsg57/kPPZdUhb+/gFxW86D08=";
|
2018-11-04 00:46:05 +00:00
|
|
|
};
|
2016-09-21 17:39:57 +00:00
|
|
|
|
2018-11-04 00:46:05 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -D bin/pg_repack -t $out/bin/
|
|
|
|
install -D lib/pg_repack.so -t $out/lib/
|
2019-07-01 14:18:03 +00:00
|
|
|
install -D lib/{pg_repack--${version}.sql,pg_repack.control} -t $out/share/postgresql/extension
|
2018-11-04 00:46:05 +00:00
|
|
|
'';
|
2016-09-21 17:39:57 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-11-04 00:46:05 +00:00
|
|
|
description = "Reorganize tables in PostgreSQL databases with minimal locks";
|
|
|
|
longDescription = ''
|
|
|
|
pg_repack is a PostgreSQL extension which lets you remove bloat from tables and indexes, and optionally restore
|
|
|
|
the physical order of clustered indexes. Unlike CLUSTER and VACUUM FULL it works online, without holding an
|
|
|
|
exclusive lock on the processed tables during processing. pg_repack is efficient to boot,
|
|
|
|
with performance comparable to using CLUSTER directly.
|
|
|
|
'';
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ danbst ];
|
|
|
|
inherit (postgresql.meta) platforms;
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
};
|
2016-09-21 17:39:57 +00:00
|
|
|
}
|