postgresql terminal entering remote database code example
Example: how to connect to remote postgres database from command line
psql -h -p -d -U -W
-W option will prompt for password
psql -h 192.168.1.50 -p 5432 -d testdb -U testuser -W
psql -h -p -d -U -W
-W option will prompt for password
psql -h 192.168.1.50 -p 5432 -d testdb -U testuser -W