Saturday, December 12, 2015

psql -c will no longer imply --no-psqlrc

Recently some very good changes were made that allow you to have multiple -c and -f arguments to psql. This is going to be quite useful. One of the things this changed as a part of this is that -c no longer implies --no-psqlrc. I found this out the hard way when it proved to be that cause of unpleasant failures by one of my buildfarm animals. This animal runs on my normal Unix workstation, where I have a .psqlrc doing various things, and it also runs a non-standard module that calls "psql -c". Until now there was no issue, because -c meant that my .psqlrc was not processed. The solution was to as "--no-psqlrc" to those psql calls. But I suspect this might catch quite a few people once 9.6 is released.

2 comments:

  1. This is definitely worth putting in the release notes with the other non-backward-compatible changes. I've frequently started using the new client packages before the new server is deployed, and I can't be the only one whose usage pattern looks like this, so it'll hit people faster than it might first appear.

    ReplyDelete
  2. I've fairly consistently used -X when doing one-liners just out of habit (-AXqt -- "axe cutey" in particular) so that looks like I pleasantly get to avoid that side effect, but good to know for sure!

    ReplyDelete