Postgres Connection

Postgresql

Postgres Connection

About

This page talks about Postgres connection.

You can:

The section below shows you how to create and customize your own connection.

Creation

To create a Postgres connection, you have the following possibilities:

In a Configuration Vault, to define a Postgres connection with the name myPostgres, you would write:

connections:
   # connection name
   myPostgres:
      uri: jdbc:postgresql://host:[port]/[databse]
      user: postgres
      password: ${MY_PASSWORD_ENV}
      driver: org.postgresql.Driver
      natives:
        # any postgres jdbc connection parameters
        # https://jdbc.postgresql.org/documentation/use/#connection-parameters
        ssl: true

The password value will be retrieved from the MY_PASSWORD_ENV environment variable

With the tabul add command of the connection module, adding a Postgres connection with the name postgresConnectionName:

  • With the Windows CMD console
tabul connection add "postgresConnectionName" "jdbc:postgresql://[host]:[port]/[database]" ^
    --user login ^
    --password password
  • With Linux Bash
tabul connection add "postgresConnectionName" "jdbc:postgresql://[host]:[port]/[database]" \
    --user login \
    --password password

For more information and customization on Postgres connection, you can check the Official documentation where the native connection properties are also listed.

Connection Attribute Reference

When creating a new connection, you may give the following properties.

URI

The URI can take one of this form

jdbc:postgresql:database
jdbc:postgresql:/
jdbc:postgresql://host/database
jdbc:postgresql://host/
jdbc:postgresql://host:port/database
jdbc:postgresql://host:port/

where:

  • host is the host name of the server. Defaults to localhost
  • port is the port number the server is listening on. Defaults to 5432
  • database is the database name. Defaults to the same name as the user name.

Native Attributes

All possible natives attributes (known as connection parameters in Postgres documentation) can be found in the Postgres connection documentation.

Task Runner