From 6390d01e1302ea3473620fcdd57f27dabe4844d1 Mon Sep 17 00:00:00 2001 From: Krisztian Szabo Date: Thu, 27 Oct 2022 16:46:14 +0200 Subject: [PATCH] postgresqlPackages.pg_relusage: init at 0.0.1 --- .../sql/postgresql/ext/pg_relusage.nix | 29 +++++++++++++++++++ pkgs/servers/sql/postgresql/packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/servers/sql/postgresql/ext/pg_relusage.nix diff --git a/pkgs/servers/sql/postgresql/ext/pg_relusage.nix b/pkgs/servers/sql/postgresql/ext/pg_relusage.nix new file mode 100644 index 000000000000..043adf725033 --- /dev/null +++ b/pkgs/servers/sql/postgresql/ext/pg_relusage.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + pname = "pg_relusage"; + version = "0.0.1"; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "adept"; + repo = pname; + rev = "refs/tags/${version}"; + sha256 = "8hJNjQ9MaBk3J9a73l+yQMwMW/F2N8vr5PO2o+5GvYs="; + }; + + installPhase = '' + install -D -t $out/lib *.so + install -D -t $out/share/postgresql/extension *.sql + install -D -t $out/share/postgresql/extension *.control + ''; + + meta = with lib; { + description = "pg_relusage extension for PostgreSQL: discover and log the relations used in your statements"; + homepage = "https://github.com/adept/pg_relusage"; + maintainers = with maintainers; [ thenonameguy ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; +} diff --git a/pkgs/servers/sql/postgresql/packages.nix b/pkgs/servers/sql/postgresql/packages.nix index 8d0b46ebc3ea..80065bde4ba1 100644 --- a/pkgs/servers/sql/postgresql/packages.nix +++ b/pkgs/servers/sql/postgresql/packages.nix @@ -62,6 +62,8 @@ self: super: { pg_partman = super.callPackage ./ext/pg_partman.nix { }; + pg_relusage = super.callPackage ./ext/pg_relusage.nix { }; + pg_safeupdate = super.callPackage ./ext/pg_safeupdate.nix { }; repmgr = super.callPackage ./ext/repmgr.nix { };