Querious Help 5

Connecting to PostgreSQL

PostgreSQL-specific settings.

To connect to a PostgreSQL server, you need:

  1. The IP address or host name of the server (or Unix socket file path).
  2. The user/role name.
  3. The password.
  4. The name of the database you're connecting to.
PostgreSQL connection settings
PostgreSQL connection settings

Connection #

Setting Notes
Connection TCP/IP or Unix Socket. A Unix socket only works when the server is on this machine, and some servers are deliberately configured to accept nothing else.
Host, Port For TCP/IP. The port defaults to 5432.
Socket Path For Unix Socket. Leave it blank to use the usual default location.
User, Password The PostgreSQL user/role name and its password.
Database The database to connect to. PostgreSQL connections are permanently bound to a single database specified at the time of the connection.
Schema Which schema inside that database the primary sidebar will focus on.

See Database / Schema Options for an explanation of Initial and Exclusive modes.

Security #

The Security popup chooses how the connection is protected.

Choice What it does
None A direct connection with no encryption arranged by Querious.
SSL Requires an encrypted connection.
See SSL Options.
SSH Tunnels the connection through an SSH session.
See SSH Tunnels.

Getting the Password from a Command #

The menu beside the password field offers the two choices:

  • Enter Password
  • From Shell Command…

Choosing From Shell Command… lets you enter a shell command that prints the password to standard output. When Querious connects, it runs this command to get the password which it then uses to connect to the server.

You can use this option to connect to a server that uses short-lived tokens for authentication, or for getting a password/credential from anywhere else.

Recipes #

To connect to a managed PostgreSQL service

  1. Set Connection to TCP/IP and enter the host and port the provider gave you.
  2. Enter the User, Password, and the Database name.
  3. Set Security to SSL — hosted services almost always require it.
  4. If the provider supplied a CA certificate, select it in CA cert file.
  5. Connect.

To connect through an SSH tunnel

  1. Set Security to SSH and fill in the SSH host, port, and user for the machine you can reach.
  2. Set Host to the address of the database server, relative to the SSH Host you're connecting to — usually 127.0.0.1 or localhost.
  3. Leave Port at the database's own port, 5432 unless it was changed.
  4. Connect. See Connecting through SSH for key-based authentication and other details.

To connect to a server with tons of schemas

  1. Fill in the connection as usual.
  2. Set Schema to the one you work in, and set its mode to Exclusive.
  3. Connect.
  4. Querious will never try to show or use any other schema, which on a large server can make a big performance difference. See Working with Large Servers.