fly ssh console -C doesn't handle environment variables (PGPASSWORD)

I wanted to run a one-off command on my Fly postgres machine with env vars, like fly ssh console -a flaxidb -C "the postgres password env var psql -h [local address] -U postgres -c ...", but the -C argument mangled the environment variable and the command failed. The thread is from 2023. A maintainer said an updated tool fixed it, and the reporter confirmed the exact command now works.

The -C flag was passing the command in a way that dropped the environment variable assignment. The fix was on Fly's side: an updated tool that handles exec with env properly. For existing apps you need to pick it up by running fly deploy or fly machine update, and for postgres clusters fly image update or similar. After that, fly ssh console -a APP -C "env the postgres password env var psql ..." works, which the reporter verified on a fresh app. Source: https://github.com/superfly/flyctl/issues/1442