I have multiple databases that I am logging into on AWS and right now I am entering the full url for the database i.e.,
psql -d psql -d postgresql://user:pass@host:port/dbname more stuff
I would like to do something link this.
Where I have some kind of config file like from the example I linked,
Name my_database1
Hostname=host_to_database
Port=port_to_database
User=username
Pass=password
DBName=dbname
Name my_database2
Hostname=host_to_database2
Port=port_to_database2
User=username2
Pass=password2
DBName=dbname2
Then I would just have to run psql -d my_database1
How do I do that?
psql -d $my_database1– phemmer Mar 29 '18 at 04:15