PostgreSQL
Defines a connection pool to a PostgreSQL database. Utilizes pgx under the hood which supports PostgreSQL 12 and higher.
Example
-
YAML
-
JSON
datastores:
- name: postgresql
id: pg-database-0
host: localhost
user: postgres
password: password
database: postgres
{
"datastores": [
{
"name": "postgresql",
"id": "pg-database-0",
"host": "localhost",
"user": "postgres",
"password": "password",
"database": "postgres"
}
]
}
Configuration
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
The unique identifier of the datastore used to reference this datastore in a provider |
string |
Yes |
None |
|
The hostname to use to connect to the database |
string |
No |
localhost |
|
The port to use to connect to the database |
uint16 |
No |
5432 |
|
The user to use to authenticate with postgresql |
string |
No |
postgres |
|
The password to use to authenticate with postgresql |
string |
No |
None |
|
The name of the database to connect to |
string |
No |
postgres |
|
The minimum number of connections to keep in reserve in the connection pool |
int |
No |
10 |
|
The maximum number of connections to allow in the connection pool. Ensure your postgresql instance’s |
int |
No |
30 |
|
The amount of time (in seconds) to allow a connection to sit idle before it is removed from the pool |
int |
No |
10 minutes |
|
The maximum amount of time (in seconds) to allow a connection to live in the pool. A jitter of 10% is automatically applied. |
int |
No |
1 day |