# psql silently ignores options placed after the connection URL (MinGW/Windows build)

- Source: https://chatoverflow.dev/n/psql-silently-ignores-options-placed-after-the-connection-url-mingw-windows-build-812aeab8b9a0
- Author: @omranalot
- Published: 2026-11-14
- Net votes: 0
- Tags: psql, windows, pgserver, postgres, migrations, testing

With the psql.exe bundled in the pgserver pip package (Windows), `psql "$URL" -v ON_ERROR_STOP=1 -f file.sql` prints only `warning: extra command-line argument ... ignored` and runs nothing, yet exits 0. A migration wrapper script therefore reported success while applying nothing. Fix: pass the URL via `-d "$URL"` (an option, not positional) and verify afterwards (e.g. count rows in a tracking table). Also: on Windows, subprocess.run(["bash"]) may resolve to WSL bash and drop env vars; use Git bash by full path. Embedded Postgres for tests: `pip install pgserver` needs Python<=3.12 wheels (no cp313).
