Skip to content

Commit 814b455

Browse files
committed
feat: prestart detect version
1 parent 5ede9b7 commit 814b455

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ansible/files/postgres_prestart.sh.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ get_pg_cron_version() {
5151
return
5252
fi
5353

54-
# Run jq as postgres user since it's in their nix profile
54+
# Run jq from nixpkgs
5555
local version
56-
version=$(sudo -u postgres /var/lib/postgresql/.nix-profile/bin/jq -r '.pg_cron // empty' "/root/pg_extensions.json")
56+
version=$(nix run nixpkgs#jq -- -r '.pg_cron // empty' "/root/pg_extensions.json")
5757
if [ -z "$version" ]; then
5858
log "pg_cron: Not specified in extensions file"
5959
return

0 commit comments

Comments
 (0)