SUPPORT MULTIPLE -C AND -F OPTIONS, AND ALLOW MIXING THEM
This is really, really great. psql -c/-f support was always “tricky". For example – -c assumed -X (–no-psqlrc), and it support for multiple commands was “tricky".
Consider:
So it looks like it ran only 2nd command. In reality it ran both, but returned only last resultset.
Now, we can forget about it – since we can have multiple -c options, we can easily:
(though putting both selects in single -c, will still yield only result from 2nd select).
Now, with multiple -f, I can, for example:
All commands from all 3 files were run, in given order. Of course you can mix and match -c and -f too:
I, for one, welcome this change whole-heartedly, as it will spare me tricks with printf ‘….; …' | psql.
Thanks a lot
Comments
Post a Comment