Skip to content

fix(psql): disable startup file loading - #3497

Open
nightcityblade wants to merge 1 commit into
rtk-ai:developfrom
nightcityblade:fix/issue-3395
Open

fix(psql): disable startup file loading#3497
nightcityblade wants to merge 1 commit into
rtk-ai:developfrom
nightcityblade:fix/issue-3395

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #3395

Summary

  • Invoke psql with -X so startup configuration cannot alter the aligned output that RTK parses.
  • Avoid duplicating the option when users already pass -X or --no-psqlrc.

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk <command> output inspected
    • N/A: exact command arguments are covered by test_build_psql_command_disables_startup_file; a live PostgreSQL server is not required for this argument-only change.

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


nightcityblade seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@HetCreep

HetCreep commented Aug 9, 2026

Copy link
Copy Markdown

Confirmed the -X fix — built this branch, the unit test passes, and it's the right call for the .psqlrc case.

One flag before this merges: the original report had three separate sub-issues, and this closes only the first. Since the PR says "Fixes #3395", merging into develop will auto-close the whole issue.

Still open, neither touched by this diff:

  • NLS translation of the (N rows) footerROW_COUNT's regex is English-only (^\(\d+ rows?\)); a non-English lc_messages produces different footer text and the row-count summary misses it. -X doesn't affect this, it's a locale setting, not a startup-file setting.
  • A literal | inside a cell value shifts columnsfilter_table's trimmed.split('|') still splits unconditionally. I fed a row with a text cell containing a|b through the current filter_table and got 3 columns back instead of 2 (["1", "a", "b"]), silently shifting every field after it. This is the one I'd worry about most since it produces a wrong answer rather than a visible failure.

Not asking for either in this PR — just flagging so they get a follow-up issue instead of disappearing when #3395 closes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtk psql parses psql's aligned table output without -X, so a user's ~/.psqlrc silently changes what rtk reads

3 participants