Reputation: 1201
psql (9.6.7, server 9.5.2) on linux
I have an init script... ~/sql.ini that I always want to run after connecting to a PG DB. I can do this by typing "\i ~/sql.ini", but is there a way to do this on the command line (which I alias) ?
Upvotes: 0
Views: 917
Reputation: 246383
Your alias should call
PSQLRC=~/sql.ini psql
That environment variable specifies the startup file that psql
executes automatically.
Upvotes: 0