Connection URLs
Postico supports using connection URLs for connecting to PostgreSQL servers.
A typical connection URL might look like this:
postgresql://jakob@localhost/marketing
This URL would connect to a server running locally (localhost), with user name "jakob", and connect to the database "marketing"
What you can do with connection URLs
-
connect to a PostgreSQL server by clicking a link on a website (eg. an internal dashboard)
-
open Postico from the command line with the open command
-
add servers to Postico (or update them) from the command line and
URL Schemes supported by Postico
Postico opens URLs with any of the following schemes:
- postgres:
- postgresql:
- redshift:
- postico:
- postgres+ssh:
- postgresql+ssh:
- postico+ssh:
postgres and postgresql can both be used for direct connections to PostgreSQL servers.
redshift is provided as an alternative for connecting to Amazon Redshift clusters. Postico treats it the same as postgres:
postico: is an alternative url scheme that you can use if you have multiple apps that support postgres: URLs, but want to open Postico specifically
postgres+ssh: can be used to connect to a PostgreSQL server via an SSH tunnel (see examples)
Example URLs
- postgres://user:password@host:port/database
- postgres+ssh://sshuser:sshpassword@sshhost:sshport/user:password@host/database
- postgres://user:password@host/database?ssh_user=sshuser&ssh_host=sshhost
Supported Query Parameters
- nickname
-
A nick name for the connection. Can be used when adding a new server, or when updating an existing server.
- uuid
-
A UUID in standard format for the server.
If none is provided, a random UUID will be generated.
This is useful if you want to update a specific server later.
Example: e6ad04c5-9ebb-4e5c-95d0-9c634f373c83
- dbname
-
The database name to connect to.
- host
-
The host name of the dataase server.
- user
-
The user name for the dataase server
- password
-
The password for the dataase server
- port
-
The port number that the database is running on. Default is 5432
- options
-
Options to send to the database backend when connecting. Required for some cloud hosting providers.
- ssh_enabled
-
Can be 'true' or 'false'. Wheter to connect via SSH tunnel or not.
- ssh_host
-
The host name of the SSH server.
- ssh_port
-
The port of the SSH server. Default is 22
- ssh_user
-
The username for authenticating with the SSH server.
- ssh_password
-
The password for the SSH server.
- ssh_private_key_path
-
Provide the path to a private key file for authenticating to an SSH server.