Since I am new to postgresql shell command lines, I am very much confused on switch between servers, databases. First, I have logged in using default values in shellSql window. It is opening second server in my pgadmin server lists(in order). But my question here is how to switch between different servers through shell commands? Example: If I have 3 servers (postgresql9, postgresql11 and remote servers).
1 Answer
This is directly given in documentation PSQL-META-COMMANDS
Examples:
=> \c mydb myuser host.dom 6432
=> \c service=foo
=> \c "host=localhost port=5432 dbname=mydb connect_timeout=10 sslmode=disable"
=> \c postgresql://tom@localhost/mydb?application_name=myapp
\connectpostgresql.org/docs/current/…\conninfoto check where you are currently connected to, see:\?for more options