diff --git a/pkgs/servers/sql/postgresql/ext/pg_ivm.nix b/pkgs/servers/sql/postgresql/ext/pg_ivm.nix new file mode 100644 index 000000000000..7e19ce2956a1 --- /dev/null +++ b/pkgs/servers/sql/postgresql/ext/pg_ivm.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + pname = "pg_ivm"; + version = "1.2"; + + src = fetchFromGitHub { + owner = "sraoss"; + repo = pname; + rev = "v${version}"; + hash = "sha256-q/iAMrT9npmtIKFKi/vSeYGvFSE+SgsKTP08YfBOpik="; + }; + + buildInputs = [ postgresql ]; + + 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 = "Materialized views with IVM (Incremental View Maintenance) for PostgreSQL"; + homepage = "https://github.com/sraoss/pg_ivm"; + maintainers = with maintainers; [ ivan ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + broken = versionOlder postgresql.version "13"; + }; +} diff --git a/pkgs/servers/sql/postgresql/packages.nix b/pkgs/servers/sql/postgresql/packages.nix index 5bbede9ddfc4..59a06ac11d48 100644 --- a/pkgs/servers/sql/postgresql/packages.nix +++ b/pkgs/servers/sql/postgresql/packages.nix @@ -16,6 +16,8 @@ self: super: { pg_hint_plan = super.callPackage ./ext/pg_hint_plan.nix { }; + pg_ivm = super.callPackage ./ext/pg_ivm.nix { }; + pg_rational = super.callPackage ./ext/pg_rational.nix { }; pg_repack = super.callPackage ./ext/pg_repack.nix { };