diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index 31ffe51c11ef..80ee32f4ee33 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -242,7 +242,7 @@ in if test -e "${cfg.dataDir}/.first_startup"; then ${optionalString (cfg.initialScript != null) '' - cat "${cfg.initialScript}" | psql --port=${toString cfg.port} postgres + psql -f "${cfg.initialScript}" --port=${toString cfg.port} postgres ''} rm -f "${cfg.dataDir}/.first_startup" fi