diff --git a/nixos/tests/postgresql.nix b/nixos/tests/postgresql.nix index b5f4e1a4c14c..54e7ec9ba17b 100644 --- a/nixos/tests/postgresql.nix +++ b/nixos/tests/postgresql.nix @@ -13,6 +13,8 @@ let INSERT INTO sth (id) VALUES (1); INSERT INTO sth (id) VALUES (1); INSERT INTO sth (id) VALUES (1); + CREATE TABLE xmltest ( doc xml ); + INSERT INTO xmltest (doc) VALUES ('ok'); -- check if libxml2 enabled ''; make-postgresql-test = postgresql-name: postgresql-package: makeTest { name = postgresql-name; @@ -41,6 +43,7 @@ let $machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 3'); $machine->succeed('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 5'); $machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 4'); + $machine->succeed('test $(psql postgres -tAc "SELECT xpath(\'/test/text()\', doc) FROM xmltest;"|wc -l) -eq 1'); $machine->shutdown; ''; diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index 2362ee843296..363fbe51adfb 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, makeWrapper }: +{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, libxml2, makeWrapper }: let @@ -15,7 +15,7 @@ let setOutputFlags = false; # $out retains configureFlags :-/ buildInputs = - [ zlib readline openssl makeWrapper ] + [ zlib readline openssl libxml2 makeWrapper ] ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ]; enableParallelBuilding = true; @@ -24,6 +24,7 @@ let configureFlags = [ "--with-openssl" + "--with-libxml" "--sysconfdir=/etc" "--libdir=$(lib)/lib" ]