# DBaaS Postgresql


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

PostgreSQL, open-source database known for its wide range of features and popularity with developers.

[Read more](https://community.exoscale.com/product/dbaas/service-specific/postgresql/)

## <span data-label="POST" class="pill-POST"></span>create-dbaas-pg-connection-pool

Create a DBaaS PostgreSQL connection pool

```
POST /dbaas-postgres/{service-name}/connection-pool
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `database-name` | string | **yes** | Service database name<br/><br/>Min length: `1`. Max length: `40`. |
| `name` | string | **yes** | Connection pool name<br/><br/>Min length: `1`. Max length: `63`. |
| `mode` | string | no | PGBouncer pool mode<br/><br/>Allowed values: `transaction`, `statement`, `session`. |
| `size` | integer | no | Size of PGBouncer's PostgreSQL side connection pool<br/><br/>Min: `1`. Max: `10000`. |
| `username` | string | no | Pool username<br/><br/>Min length: `1`. Max length: `64`. |

<details>
<summary>Example</summary>

```json
{
  "database-name": "string",
  "mode": "transaction",
  "name": "string",
  "size": 0,
  "username": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-dbaas-pg-connection-pool`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASPGConnectionPool) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_pg_connection_pool) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasPgConnectionPool(java.lang.String,com.exoscale.sdk.model.CreateDbaasPgConnectionPoolRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-pg-connection-pool`

## <span data-label="PUT" class="pill-PUT"></span>update-dbaas-pg-connection-pool

Update a DBaaS PostgreSQL connection pool

```
PUT /dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `connection-pool-name` | `path` | Min length: `1`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `database-name` | string | no | Service database name<br/><br/>Min length: `1`. Max length: `40`. |
| `mode` | string | no | PGBouncer pool mode<br/><br/>Allowed values: `transaction`, `statement`, `session`. |
| `size` | integer | no | Size of PGBouncer's PostgreSQL side connection pool<br/><br/>Min: `1`. Max: `10000`. |
| `username` | string | no | Pool username<br/><br/>Min length: `1`. Max length: `64`. |

<details>
<summary>Example</summary>

```json
{
  "database-name": "string",
  "mode": "transaction",
  "size": 0,
  "username": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-dbaas-pg-connection-pool`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateDBAASPGConnectionPool) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_dbaas_pg_connection_pool) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateDbaasPgConnectionPool(java.lang.String,java.lang.String,com.exoscale.sdk.model.UpdateDbaasPgConnectionPoolRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-dbaas-pg-connection-pool`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-dbaas-pg-connection-pool

Delete a DBaaS PostgreSQL connection pool

```
DELETE /dbaas-postgres/{service-name}/connection-pool/{connection-pool-name}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `connection-pool-name` | `path` | Min length: `1`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-dbaas-pg-connection-pool`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteDBAASPGConnectionPool) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_dbaas_pg_connection_pool) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteDbaasPgConnectionPool(java.lang.String,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-dbaas-pg-connection-pool`

## <span data-label="POST" class="pill-POST"></span>create-dbaas-pg-database

Create a DBaaS Postgres database

```
POST /dbaas-postgres/{service-name}/database
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `database-name` | string | **yes** | Service database name<br/><br/>Min length: `1`. Max length: `40`. |
| `lc-collate` | string | no | Default string sort order (LC_COLLATE) for PostgreSQL database<br/><br/>Max length: `128`. |
| `lc-ctype` | string | no | Default character classification (LC_CTYPE) for PostgreSQL database<br/><br/>Max length: `128`. |

<details>
<summary>Example</summary>

```json
{
  "database-name": "string",
  "lc-collate": "string",
  "lc-ctype": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-dbaas-pg-database`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASPGDatabase) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_pg_database) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasPgDatabase(java.lang.String,com.exoscale.sdk.model.CreateDbaasPgDatabaseRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-pg-database`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-dbaas-pg-database

Delete a DBaaS Postgres database

```
DELETE /dbaas-postgres/{service-name}/database/{database-name}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `database-name` | `path` | Min length: `1`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-dbaas-pg-database`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteDBAASPGDatabase) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_dbaas_pg_database) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteDbaasPgDatabase(java.lang.String,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-dbaas-pg-database`

## <span data-label="POST" class="pill-POST"></span>create-dbaas-postgres-user

Create a DBaaS Postgres user

```
POST /dbaas-postgres/{service-name}/user
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `username` | string | **yes** | Username<br/><br/>Min length: `1`. Max length: `64`. |
| `allow-replication` | boolean | no |  |

<details>
<summary>Example</summary>

```json
{
  "allow-replication": true,
  "username": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-dbaas-postgres-user`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASPostgresUser) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_postgres_user) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasPostgresUser(java.lang.String,com.exoscale.sdk.model.CreateDbaasPostgresUserRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-postgres-user`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-dbaas-postgres-user

Delete a DBaaS Postgres user

```
DELETE /dbaas-postgres/{service-name}/user/{username}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `username` | `path` | Min length: `1`. Max length: `64`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-dbaas-postgres-user`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteDBAASPostgresUser) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_dbaas_postgres_user) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteDbaasPostgresUser(java.lang.String,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-dbaas-postgres-user`

## <span data-label="GET" class="pill-GET"></span>reveal-dbaas-postgres-user-password

Reveal the secrets of a DBaaS Postgres user

```
GET /dbaas-postgres/{service-name}/user/{username}/password/reveal
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `username` | `path` | Min length: `1`. Max length: `64`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `password` | string | Postgres password |
| `username` | string | Postgres username |

<details>
<summary>Example output</summary>

```json
{
  "password": "string",
  "username": "string"
}
```
</details>


SDK reference for `reveal-dbaas-postgres-user-password`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.RevealDBAASPostgresUserPassword) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reveal_dbaas_postgres_user_password) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#revealDbaasPostgresUserPassword(java.lang.String,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reveal-dbaas-postgres-user-password`

## <span data-label="PUT" class="pill-PUT"></span>reset-dbaas-postgres-user-password

Reset the credentials of a DBaaS Postgres user

```
PUT /dbaas-postgres/{service-name}/user/{username}/password/reset
```

If no password is provided one will be generated automatically.

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `username` | `path` | Min length: `1`. Max length: `64`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string | no | New password<br/><br/>Min length: `8`. Max length: `256`. |

<details>
<summary>Example</summary>

```json
{
  "password": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `reset-dbaas-postgres-user-password`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetDBAASPostgresUserPassword) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_dbaas_postgres_user_password) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetDbaasPostgresUserPassword(java.lang.String,java.lang.String,com.exoscale.sdk.model.ResetDbaasPostgresUserPasswordRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-dbaas-postgres-user-password`

## <span data-label="POST" class="pill-POST"></span>create-dbaas-service-pg

Create a DBaaS PostgreSQL service

```
POST /dbaas-postgres/{name}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | **yes** | Subscription plan<br/><br/>Min length: `1`. Max length: `128`. |
| `admin-password` | string | no | Custom password for admin user. Defaults to random string. This must be set only when a new service is being created.<br/><br/>Min length: `8`. Max length: `256`. |
| `admin-username` | string | no | Custom username for admin user. This must be set only when a new service is being created.<br/><br/>Min length: `1`. Max length: `64`. |
| `backup-schedule` | [Backup Schedule](#backup-schedule) | no |  |
| `fork-from-service` | string | no | Service to fork from<br/><br/>Min length: `0`. Max length: `63`. |
| `integrations` | array of [Integrations](#integrations) | no | Service integrations to be enabled when creating the service. |
| `ip-filter` | array[string] | no | Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16' |
| `maintenance` | [Maintenance](#maintenance) | no | Automatic maintenance settings |
| `migration` | [Migration](#migration) | no | Migrate data from existing server |
| `pg-settings` | [postgresql.conf configuration values](/reference/api/_schemas/json-schema-pg/) | no | PostgreSQL-specific settings |
| `pgaudit-settings` | [System-wide settings for the pgaudit extension.](/reference/api/_schemas/json-schema-pgaudit/) | no | PGAudit settings |
| `pgbouncer-settings` | [System-wide settings for pgbouncer.](/reference/api/_schemas/json-schema-pgbouncer/) | no | PGBouncer connection pooling settings |
| `pglookout-settings` | [System-wide settings for pglookout.](/reference/api/_schemas/json-schema-pglookout/) | no | PGLookout settings |
| `recovery-backup-time` | string | no | ISO time of a backup to recover from for services that support arbitrary times<br/><br/>Min length: `1`. |
| `shared-buffers-percentage` | integer | no | Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.<br/><br/>Min: `20`. Max: `60`. |
| `synchronous-replication` | string | no | Synchronous replication type. Note that the service plan also needs to support synchronous replication.<br/><br/>Allowed values: `quorum`, `off`. |
| `termination-protection` | boolean | no | Service is protected against termination and powering off |
| `timescaledb-settings` | [System-wide settings for the timescaledb extension](/reference/api/_schemas/json-schema-timescaledb/) | no | TimescaleDB extension configuration values |
| `variant` | string | no | Variant of the PostgreSQL service, may affect the features that are exposed by default<br/><br/>Allowed values: `timescale`, `aiven`. |
| `version` | string | no | PostgreSQL major version<br/><br/>Allowed values: `14`, `17`, `15`, `18`, `13`, `16`. |
| `work-mem` | integer | no | Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).<br/><br/>Min: `1`. Max: `1024`. |

<details>
<summary>Example</summary>

```json
{
  "admin-password": "string",
  "admin-username": "string",
  "backup-schedule": {
    "backup-hour": 0,
    "backup-minute": 0
  },
  "fork-from-service": "string",
  "integrations": [
    {
      "dest-service": "string",
      "settings": {},
      "source-service": "string",
      "type": "read_replica"
    }
  ],
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string"
  },
  "migration": {
    "dbname": "string",
    "host": "string",
    "ignore-dbs": "string",
    "method": "dump",
    "password": "string",
    "port": 0,
    "ssl": true,
    "username": "string"
  },
  "pg-settings": {
    "autovacuum": {
      "autovacuum_analyze_scale_factor": 0,
      "autovacuum_analyze_threshold": 0,
      "autovacuum_freeze_max_age": 0,
      "autovacuum_max_workers": 0,
      "autovacuum_naptime": 0,
      "autovacuum_vacuum_cost_delay": 0,
      "autovacuum_vacuum_cost_limit": 0,
      "autovacuum_vacuum_scale_factor": 0,
      "autovacuum_vacuum_threshold": 0,
      "log_autovacuum_min_duration": 0
    },
    "bg-writer": {
      "bgwriter_delay": 0,
      "bgwriter_flush_after": 0,
      "bgwriter_lru_maxpages": 0,
      "bgwriter_lru_multiplier": 0
    },
    "deadlock_timeout": 0,
    "default_toast_compression": "lz4",
    "idle_in_transaction_session_timeout": 0,
    "io_combine_limit": 0,
    "io_max_combine_limit": 0,
    "io_max_concurrency": 0,
    "io_method": "worker",
    "io_workers": 0,
    "jit": true,
    "log_error_verbosity": "TERSE",
    "log_line_prefix": "'pid=%p,user=%u,db=%d,app=%a,client=%h '",
    "log_min_duration_statement": 0,
    "log_temp_files": 0,
    "max_files_per_process": 0,
    "max_locks_per_transaction": 0,
    "max_logical_replication_workers": 0,
    "max_parallel_workers": 0,
    "max_parallel_workers_per_gather": 0,
    "max_pred_locks_per_transaction": 0,
    "max_prepared_transactions": 0,
    "max_replication_slots": 0,
    "max_stack_depth": 0,
    "max_standby_archive_delay": 0,
    "max_standby_streaming_delay": 0,
    "max_sync_workers_per_subscription": 0,
    "max_worker_processes": 0,
    "password_encryption": "md5",
    "pg_partman_bgw.interval": 0,
    "pg_partman_bgw.role": "myrolename",
    "pg_stat_monitor.pgsm_enable_query_plan": true,
    "pg_stat_monitor.pgsm_max_buckets": 0,
    "pg_stat_statements.track": "all",
    "temp_file_limit": 0,
    "timezone": "Europe/Helsinki",
    "track_activity_query_size": 0,
    "track_commit_timestamp": "off",
    "track_functions": "all",
    "track_io_timing": "off",
    "wal": {
      "max_slot_wal_keep_size": 0,
      "max_wal_senders": 0,
      "wal_sender_timeout": 0,
      "wal_writer_delay": 0
    }
  },
  "pgaudit-settings": {
    "feature_enabled": true,
    "log": [
      "all"
    ],
    "log_catalog": true,
    "log_client": true,
    "log_level": "debug1",
    "log_max_string_length": 0,
    "log_nested_statements": true,
    "log_parameter": true,
    "log_parameter_max_size": 0,
    "log_relation": true,
    "log_rows": true,
    "log_statement": true,
    "log_statement_once": true,
    "role": "string"
  },
  "pgbouncer-settings": {
    "autodb_idle_timeout": 0,
    "autodb_max_db_connections": 0,
    "autodb_pool_mode": "transaction",
    "autodb_pool_size": 0,
    "ignore_startup_parameters": [
      "extra_float_digits"
    ],
    "max_prepared_statements": 0,
    "min_pool_size": 0,
    "server_idle_timeout": 0,
    "server_lifetime": 0,
    "server_reset_query_always": true
  },
  "pglookout-settings": {
    "max_failover_replication_time_lag": 0
  },
  "plan": "string",
  "recovery-backup-time": "string",
  "shared-buffers-percentage": 0,
  "synchronous-replication": "quorum",
  "termination-protection": true,
  "timescaledb-settings": {
    "max_background_workers": 0
  },
  "variant": "timescale",
  "version": "14",
  "work-mem": 0
}
```
</details>


### Backup Schedule {#backup-schedule}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `backup-hour` | integer | no | The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.<br/><br/>Min: `0`. Max: `23`. |
| `backup-minute` | integer | no | The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.<br/><br/>Min: `0`. Max: `59`. |

### Integrations {#integrations}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | **yes** | Integration type<br/><br/>Allowed values: `read_replica`. |
| `dest-service` | string | no | A destination service<br/><br/>Min length: `0`. Max length: `63`. |
| `settings` | object | no | Integration settings |
| `source-service` | string | no | A source service<br/><br/>Min length: `0`. Max length: `63`. |

### Maintenance {#maintenance}

Automatic maintenance settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `dow` | string | **yes** | Day of week for installing updates<br/><br/>Allowed values: `saturday`, `tuesday`, `never`, `wednesday`, `sunday`, `friday`, `monday`, `thursday`. |
| `time` | string | **yes** | Time for installing updates, UTC<br/><br/>Min length: `8`. Max length: `8`. |

### Migration {#migration}

Migrate data from existing server

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `host` | string | **yes** | Hostname or IP address of the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |
| `port` | integer | **yes** | Port number of the server where to migrate data from<br/><br/>Min: `1`. Max: `65535`. |
| `dbname` | string | no | Database name for bootstrapping the initial connection<br/><br/>Min length: `1`. Max length: `63`. |
| `ignore-dbs` | string | no | Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)<br/><br/>Min length: `1`. Max length: `2048`. |
| `method` | string | no | The migration method to be used<br/><br/>Allowed values: `dump`, `replication`. |
| `password` | string | no | Password for authentication with the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |
| `ssl` | boolean | no | The server where to migrate data from is secured with SSL |
| `username` | string | no | User name for authentication with the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-dbaas-service-pg`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASServicePG) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_service_pg) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasServicePg(java.lang.String,com.exoscale.sdk.model.CreateDbaasServicePgRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-service-pg`

## <span data-label="GET" class="pill-GET"></span>get-dbaas-service-pg

Get a DBaaS PostgreSQL service

```
GET /dbaas-postgres/{name}
```

Get a DBaaS PostgreSQL service

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `backup-schedule` | [Backup Schedule](/reference/api/_schemas/dbaas-service-pg/#backup-schedule) | Backup schedule |
| `backups` | array of [List of backups for the service](/reference/api/_schemas/dbaas-service-backup/) | List of backups for the service |
| `components` | array of [Components](/reference/api/_schemas/dbaas-service-pg/#components) | Service component information objects |
| `connection-info` | [Connection Info](/reference/api/_schemas/dbaas-service-pg/#connection-info) | PG connection information properties |
| `connection-pools` | array of [Connection Pools](/reference/api/_schemas/dbaas-service-pg/#connection-pools) | PostgreSQL PGBouncer connection pools |
| `created-at` | string | Service creation timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `databases` | array of [DBaaS Database Name](/reference/api/_schemas/dbaas-database-name/) | List of PostgreSQL databases |
| `disk-size` | integer | TODO UNIT disk space for data storage<br/><br/>Min: `0`. |
| `integrations` | array of [DBaaS Integration](/reference/api/_schemas/dbaas-integration/) | Service integrations |
| `ip-filter` | array[string] | Allowed CIDR address blocks for incoming connections |
| `maintenance` | [Automatic maintenance settings](/reference/api/_schemas/dbaas-service-maintenance/) | Automatic maintenance settings |
| `max-connections` | integer | Maximum number of connections allowed to an instance<br/><br/>Min: `0`. |
| `name` | string | Service name<br/><br/>Min length: `0`. Max length: `63`. |
| `node-count` | integer | Number of service nodes in the active plan<br/><br/>Min: `0`. |
| `node-cpu-count` | integer | Number of CPUs for each node<br/><br/>Min: `0`. |
| `node-memory` | integer | TODO UNIT of memory for each node<br/><br/>Min: `0`. |
| `node-states` | array of [Automatic maintenance settings](/reference/api/_schemas/dbaas-node-state/) | State of individual service nodes |
| `notifications` | array of [Service notifications](/reference/api/_schemas/dbaas-service-notification/) | Service notifications |
| `pg-settings` | [postgresql.conf configuration values](/reference/api/_schemas/json-schema-pg/) | PostgreSQL-specific settings |
| `pgaudit-settings` | [System-wide settings for the pgaudit extension.](/reference/api/_schemas/json-schema-pgaudit/) | PGAudit settings |
| `pgbouncer-settings` | [System-wide settings for pgbouncer.](/reference/api/_schemas/json-schema-pgbouncer/) | PGBouncer connection pooling settings |
| `pglookout-settings` | [System-wide settings for pglookout.](/reference/api/_schemas/json-schema-pglookout/) | PGLookout settings |
| `plan` | string | Subscription plan |
| `prometheus-uri` | [Prometheus URI](/reference/api/_schemas/dbaas-service-pg/#prometheus-uri) | Prometheus integration URI |
| `shared-buffers-percentage` | integer | Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.<br/><br/>Min: `20`. Max: `60`. |
| `state` | string | State of the service<br/><br/>Allowed values: `running`, `rebuilding`, `rebalancing`, `poweroff`. |
| `synchronous-replication` | string | Synchronous replication type. Note that the service plan also needs to support synchronous replication.<br/><br/>Allowed values: `quorum`, `off`. |
| `termination-protection` | boolean | Service is protected against termination and powering off |
| `timescaledb-settings` | [System-wide settings for the timescaledb extension](/reference/api/_schemas/json-schema-timescaledb/) | TimescaleDB extension configuration values |
| `type` | string | Service type code<br/><br/>Min length: `0`. Max length: `64`. |
| `updated-at` | string | Service last update timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `uri` | string | URI for connecting to the service (may be absent) |
| `uri-params` | object | service_uri parameterized into key-value pairs |
| `users` | array of [Users](/reference/api/_schemas/dbaas-service-pg/#users) | List of service users |
| `version` | string | PostgreSQL version |
| `work-mem` | integer | Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).<br/><br/>Min: `1`. Max: `1024`. |
| `zone` | string | The zone where the service is running |

<details>
<summary>Example output</summary>

```json
{
  "backup-schedule": {
    "backup-hour": 0,
    "backup-minute": 0
  },
  "backups": [
    {
      "backup-name": "string",
      "backup-time": "2024-01-01T12:00:00Z",
      "data-size": 0
    }
  ],
  "components": [
    {
      "component": "string",
      "host": "string",
      "port": 0,
      "route": "dynamic",
      "usage": "primary"
    }
  ],
  "connection-info": {
    "params": [
      {}
    ],
    "standby": [
      "string"
    ],
    "syncing": [
      "string"
    ],
    "uri": [
      "string"
    ]
  },
  "connection-pools": [
    {
      "connection-uri": "string",
      "database": "string",
      "mode": "transaction",
      "name": "string",
      "size": 0,
      "username": "string"
    }
  ],
  "created-at": "2024-01-01T12:00:00Z",
  "databases": [
    "string"
  ],
  "disk-size": 0,
  "integrations": [
    {
      "description": "string",
      "dest": "string",
      "id": "string",
      "is-active": true,
      "is-enabled": true,
      "settings": {},
      "source": "string",
      "status": "string",
      "type": "string"
    }
  ],
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string",
    "updates": [
      {
        "deadline": "2024-01-01T12:00:00Z",
        "description": "string",
        "start-after": "2024-01-01T12:00:00Z",
        "start-at": "2024-01-01T12:00:00Z"
      }
    ]
  },
  "max-connections": 0,
  "name": "string",
  "node-count": 0,
  "node-cpu-count": 0,
  "node-memory": 0,
  "node-states": [
    {
      "name": "string",
      "progress-updates": [
        {
          "completed": true,
          "current": 0,
          "max": 0,
          "min": 0,
          "phase": "stream",
          "unit": "string"
        }
      ],
      "role": "standby",
      "state": "leaving"
    }
  ],
  "notifications": [
    {
      "level": "warning",
      "message": "string",
      "metadata": {},
      "type": "service_powered_off_removal"
    }
  ],
  "pg-settings": {
    "autovacuum": {
      "autovacuum_analyze_scale_factor": 0,
      "autovacuum_analyze_threshold": 0,
      "autovacuum_freeze_max_age": 0,
      "autovacuum_max_workers": 0,
      "autovacuum_naptime": 0,
      "autovacuum_vacuum_cost_delay": 0,
      "autovacuum_vacuum_cost_limit": 0,
      "autovacuum_vacuum_scale_factor": 0,
      "autovacuum_vacuum_threshold": 0,
      "log_autovacuum_min_duration": 0
    },
    "bg-writer": {
      "bgwriter_delay": 0,
      "bgwriter_flush_after": 0,
      "bgwriter_lru_maxpages": 0,
      "bgwriter_lru_multiplier": 0
    },
    "deadlock_timeout": 0,
    "default_toast_compression": "lz4",
    "idle_in_transaction_session_timeout": 0,
    "io_combine_limit": 0,
    "io_max_combine_limit": 0,
    "io_max_concurrency": 0,
    "io_method": "worker",
    "io_workers": 0,
    "jit": true,
    "log_error_verbosity": "TERSE",
    "log_line_prefix": "'pid=%p,user=%u,db=%d,app=%a,client=%h '",
    "log_min_duration_statement": 0,
    "log_temp_files": 0,
    "max_files_per_process": 0,
    "max_locks_per_transaction": 0,
    "max_logical_replication_workers": 0,
    "max_parallel_workers": 0,
    "max_parallel_workers_per_gather": 0,
    "max_pred_locks_per_transaction": 0,
    "max_prepared_transactions": 0,
    "max_replication_slots": 0,
    "max_stack_depth": 0,
    "max_standby_archive_delay": 0,
    "max_standby_streaming_delay": 0,
    "max_sync_workers_per_subscription": 0,
    "max_worker_processes": 0,
    "password_encryption": "md5",
    "pg_partman_bgw.interval": 0,
    "pg_partman_bgw.role": "myrolename",
    "pg_stat_monitor.pgsm_enable_query_plan": true,
    "pg_stat_monitor.pgsm_max_buckets": 0,
    "pg_stat_statements.track": "all",
    "temp_file_limit": 0,
    "timezone": "Europe/Helsinki",
    "track_activity_query_size": 0,
    "track_commit_timestamp": "off",
    "track_functions": "all",
    "track_io_timing": "off",
    "wal": {
      "max_slot_wal_keep_size": 0,
      "max_wal_senders": 0,
      "wal_sender_timeout": 0,
      "wal_writer_delay": 0
    }
  },
  "pgaudit-settings": {
    "feature_enabled": true,
    "log": [
      "all"
    ],
    "log_catalog": true,
    "log_client": true,
    "log_level": "debug1",
    "log_max_string_length": 0,
    "log_nested_statements": true,
    "log_parameter": true,
    "log_parameter_max_size": 0,
    "log_relation": true,
    "log_rows": true,
    "log_statement": true,
    "log_statement_once": true,
    "role": "string"
  },
  "pgbouncer-settings": {
    "autodb_idle_timeout": 0,
    "autodb_max_db_connections": 0,
    "autodb_pool_mode": "transaction",
    "autodb_pool_size": 0,
    "ignore_startup_parameters": [
      "extra_float_digits"
    ],
    "max_prepared_statements": 0,
    "min_pool_size": 0,
    "server_idle_timeout": 0,
    "server_lifetime": 0,
    "server_reset_query_always": true
  },
  "pglookout-settings": {
    "max_failover_replication_time_lag": 0
  },
  "plan": "string",
  "prometheus-uri": {
    "host": "string",
    "port": 0
  },
  "shared-buffers-percentage": 0,
  "state": "running",
  "synchronous-replication": "quorum",
  "termination-protection": true,
  "timescaledb-settings": {
    "max_background_workers": 0
  },
  "type": "string",
  "updated-at": "2024-01-01T12:00:00Z",
  "uri": "string",
  "uri-params": {},
  "users": [
    {
      "allow-replication": true,
      "password": "string",
      "type": "string",
      "username": "string"
    }
  ],
  "version": "string",
  "work-mem": 0,
  "zone": "string"
}
```
</details>


SDK reference for `get-dbaas-service-pg`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetDBAASServicePG) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_dbaas_service_pg) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getDbaasServicePg(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-dbaas-service-pg`

## <span data-label="PUT" class="pill-PUT"></span>update-dbaas-service-pg

Update a DBaaS PostgreSQL service

```
PUT /dbaas-postgres/{name}
```

Update a DBaaS PostgreSQL service

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `backup-schedule` | [Backup Schedule](#backup-schedule) | no |  |
| `ip-filter` | array[string] | no | Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16' |
| `maintenance` | [Maintenance](#maintenance) | no | Automatic maintenance settings |
| `migration` | [Migration](#migration) | no | Migrate data from existing server |
| `pg-settings` | [postgresql.conf configuration values](/reference/api/_schemas/json-schema-pg/) | no | PostgreSQL-specific settings |
| `pgaudit-settings` | [System-wide settings for the pgaudit extension.](/reference/api/_schemas/json-schema-pgaudit/) | no | PGAudit settings |
| `pgbouncer-settings` | [System-wide settings for pgbouncer.](/reference/api/_schemas/json-schema-pgbouncer/) | no | PGBouncer connection pooling settings |
| `pglookout-settings` | [System-wide settings for pglookout.](/reference/api/_schemas/json-schema-pglookout/) | no | PGLookout settings |
| `plan` | string | no | Subscription plan<br/><br/>Min length: `1`. Max length: `128`. |
| `shared-buffers-percentage` | integer | no | Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.<br/><br/>Min: `20`. Max: `60`. |
| `synchronous-replication` | string | no | Synchronous replication type. Note that the service plan also needs to support synchronous replication.<br/><br/>Allowed values: `quorum`, `off`. |
| `termination-protection` | boolean | no | Service is protected against termination and powering off |
| `timescaledb-settings` | [System-wide settings for the timescaledb extension](/reference/api/_schemas/json-schema-timescaledb/) | no | TimescaleDB extension configuration values |
| `variant` | string | no | Variant of the PostgreSQL service, may affect the features that are exposed by default<br/><br/>Allowed values: `timescale`, `aiven`. |
| `version` | string | no | Version |
| `work-mem` | integer | no | Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).<br/><br/>Min: `1`. Max: `1024`. |

<details>
<summary>Example</summary>

```json
{
  "backup-schedule": {
    "backup-hour": 0,
    "backup-minute": 0
  },
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string"
  },
  "migration": {
    "dbname": "string",
    "host": "string",
    "ignore-dbs": "string",
    "method": "dump",
    "password": "string",
    "port": 0,
    "ssl": true,
    "username": "string"
  },
  "pg-settings": {
    "autovacuum": {
      "autovacuum_analyze_scale_factor": 0,
      "autovacuum_analyze_threshold": 0,
      "autovacuum_freeze_max_age": 0,
      "autovacuum_max_workers": 0,
      "autovacuum_naptime": 0,
      "autovacuum_vacuum_cost_delay": 0,
      "autovacuum_vacuum_cost_limit": 0,
      "autovacuum_vacuum_scale_factor": 0,
      "autovacuum_vacuum_threshold": 0,
      "log_autovacuum_min_duration": 0
    },
    "bg-writer": {
      "bgwriter_delay": 0,
      "bgwriter_flush_after": 0,
      "bgwriter_lru_maxpages": 0,
      "bgwriter_lru_multiplier": 0
    },
    "deadlock_timeout": 0,
    "default_toast_compression": "lz4",
    "idle_in_transaction_session_timeout": 0,
    "io_combine_limit": 0,
    "io_max_combine_limit": 0,
    "io_max_concurrency": 0,
    "io_method": "worker",
    "io_workers": 0,
    "jit": true,
    "log_error_verbosity": "TERSE",
    "log_line_prefix": "'pid=%p,user=%u,db=%d,app=%a,client=%h '",
    "log_min_duration_statement": 0,
    "log_temp_files": 0,
    "max_files_per_process": 0,
    "max_locks_per_transaction": 0,
    "max_logical_replication_workers": 0,
    "max_parallel_workers": 0,
    "max_parallel_workers_per_gather": 0,
    "max_pred_locks_per_transaction": 0,
    "max_prepared_transactions": 0,
    "max_replication_slots": 0,
    "max_stack_depth": 0,
    "max_standby_archive_delay": 0,
    "max_standby_streaming_delay": 0,
    "max_sync_workers_per_subscription": 0,
    "max_worker_processes": 0,
    "password_encryption": "md5",
    "pg_partman_bgw.interval": 0,
    "pg_partman_bgw.role": "myrolename",
    "pg_stat_monitor.pgsm_enable_query_plan": true,
    "pg_stat_monitor.pgsm_max_buckets": 0,
    "pg_stat_statements.track": "all",
    "temp_file_limit": 0,
    "timezone": "Europe/Helsinki",
    "track_activity_query_size": 0,
    "track_commit_timestamp": "off",
    "track_functions": "all",
    "track_io_timing": "off",
    "wal": {
      "max_slot_wal_keep_size": 0,
      "max_wal_senders": 0,
      "wal_sender_timeout": 0,
      "wal_writer_delay": 0
    }
  },
  "pgaudit-settings": {
    "feature_enabled": true,
    "log": [
      "all"
    ],
    "log_catalog": true,
    "log_client": true,
    "log_level": "debug1",
    "log_max_string_length": 0,
    "log_nested_statements": true,
    "log_parameter": true,
    "log_parameter_max_size": 0,
    "log_relation": true,
    "log_rows": true,
    "log_statement": true,
    "log_statement_once": true,
    "role": "string"
  },
  "pgbouncer-settings": {
    "autodb_idle_timeout": 0,
    "autodb_max_db_connections": 0,
    "autodb_pool_mode": "transaction",
    "autodb_pool_size": 0,
    "ignore_startup_parameters": [
      "extra_float_digits"
    ],
    "max_prepared_statements": 0,
    "min_pool_size": 0,
    "server_idle_timeout": 0,
    "server_lifetime": 0,
    "server_reset_query_always": true
  },
  "pglookout-settings": {
    "max_failover_replication_time_lag": 0
  },
  "plan": "string",
  "shared-buffers-percentage": 0,
  "synchronous-replication": "quorum",
  "termination-protection": true,
  "timescaledb-settings": {
    "max_background_workers": 0
  },
  "variant": "timescale",
  "version": "string",
  "work-mem": 0
}
```
</details>


### Backup Schedule {#backup-schedule}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `backup-hour` | integer | no | The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.<br/><br/>Min: `0`. Max: `23`. |
| `backup-minute` | integer | no | The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.<br/><br/>Min: `0`. Max: `59`. |

### Maintenance {#maintenance}

Automatic maintenance settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `dow` | string | **yes** | Day of week for installing updates<br/><br/>Allowed values: `saturday`, `tuesday`, `never`, `wednesday`, `sunday`, `friday`, `monday`, `thursday`. |
| `time` | string | **yes** | Time for installing updates, UTC<br/><br/>Min length: `8`. Max length: `8`. |

### Migration {#migration}

Migrate data from existing server

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `host` | string | **yes** | Hostname or IP address of the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |
| `port` | integer | **yes** | Port number of the server where to migrate data from<br/><br/>Min: `1`. Max: `65535`. |
| `dbname` | string | no | Database name for bootstrapping the initial connection<br/><br/>Min length: `1`. Max length: `63`. |
| `ignore-dbs` | string | no | Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)<br/><br/>Min length: `1`. Max length: `2048`. |
| `method` | string | no | The migration method to be used<br/><br/>Allowed values: `dump`, `replication`. |
| `password` | string | no | Password for authentication with the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |
| `ssl` | boolean | no | The server where to migrate data from is secured with SSL |
| `username` | string | no | User name for authentication with the server where to migrate data from<br/><br/>Min length: `1`. Max length: `255`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-dbaas-service-pg`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateDBAASServicePG) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_dbaas_service_pg) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateDbaasServicePg(java.lang.String,com.exoscale.sdk.model.UpdateDbaasServicePgRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-dbaas-service-pg`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-dbaas-service-pg

Delete a Postgres service

```
DELETE /dbaas-postgres/{name}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` |  |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-dbaas-service-pg`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteDBAASServicePG) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_dbaas_service_pg) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteDbaasServicePg(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-dbaas-service-pg`


---

## Other Operations

## <span data-label="PUT" class="pill-PUT"></span>start-dbaas-pg-maintenance

Initiate PostgreSQL maintenance update

```
PUT /dbaas-postgres/{name}/maintenance/start
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `start-dbaas-pg-maintenance`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.StartDBAASPGMaintenance) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.start_dbaas_pg_maintenance) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#startDbaasPgMaintenance(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api start-dbaas-pg-maintenance`

## <span data-label="POST" class="pill-POST"></span>stop-dbaas-pg-migration

Stop a DBaaS PostgreSQL migration

```
POST /dbaas-postgres/{name}/migration/stop
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `stop-dbaas-pg-migration`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.StopDBAASPGMigration) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.stop_dbaas_pg_migration) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#stopDbaasPgMigration(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api stop-dbaas-pg-migration`

## <span data-label="POST" class="pill-POST"></span>create-dbaas-pg-upgrade-check

```
POST /dbaas-postgres/{service}/upgrade-check
```

Check whether you can upgrade Postgres service to a newer version

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `target-version` | string | **yes** | Target version for upgrade<br/><br/>Allowed values: `14`, `17`, `15`, `18`, `13`, `16`. |

<details>
<summary>Example</summary>

```json
{
  "target-version": "14"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `create-time` | string | ISO 8601 date-time. |
| `id` | string | Must be a valid UUID. |
| `result` | string |  |
| `result-codes` | array of [Result Codes](/reference/api/_schemas/dbaas-task/#result-codes) |  |
| `success` | boolean |  |
| `task-type` | string |  |

<details>
<summary>Example output</summary>

```json
{
  "create-time": "2024-01-01T12:00:00Z",
  "id": "string",
  "result": "string",
  "result-codes": [
    {
      "code": "string",
      "dbname": "string"
    }
  ],
  "success": true,
  "task-type": "string"
}
```
</details>


SDK reference for `create-dbaas-pg-upgrade-check`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASPGUpgradeCheck) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_pg_upgrade_check) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasPgUpgradeCheck(java.lang.String,com.exoscale.sdk.model.CreateDbaasPgUpgradeCheckRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-pg-upgrade-check`

## <span data-label="PUT" class="pill-PUT"></span>update-dbaas-postgres-allow-replication

Update access control for one service user

```
PUT /dbaas-postgres/{service-name}/user/{username}/allow-replication
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `username` | `path` | Min length: `1`. Max length: `64`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `allow-replication` | boolean | no |  |

<details>
<summary>Example</summary>

```json
{
  "allow-replication": true
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `users` | array of [Users](/reference/api/_schemas/dbaas-postgres-users/#users) |  |

<details>
<summary>Example output</summary>

```json
{
  "users": [
    {
      "allow-replication": true,
      "username": "string"
    }
  ]
}
```
</details>


SDK reference for `update-dbaas-postgres-allow-replication`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateDBAASPostgresAllowReplication) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_dbaas_postgres_allow_replication) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateDbaasPostgresAllowReplication(java.lang.String,java.lang.String,com.exoscale.sdk.model.UpdateDbaasPostgresAllowReplicationRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-dbaas-postgres-allow-replication`

## <span data-label="GET" class="pill-GET"></span>get-dbaas-settings-pg

Get DBaaS PostgreSQL settings

```
GET /dbaas-settings-pg
```

Get DBaaS PostgreSQL settings

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `settings` | [Settings](#settings) |  |

<details>
<summary>Example output</summary>

```json
{
  "settings": {
    "pg": {
      "additionalProperties": true,
      "properties": {},
      "title": "string",
      "type": "string"
    },
    "pgbouncer": {
      "additionalProperties": true,
      "properties": {},
      "title": "string",
      "type": "string"
    },
    "pglookout": {
      "additionalProperties": true,
      "properties": {},
      "title": "string",
      "type": "string"
    },
    "timescaledb": {
      "additionalProperties": true,
      "properties": {},
      "title": "string",
      "type": "string"
    }
  }
}
```
</details>


### Settings {#settings}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `pg` | [PG](#pg) | no | postgresql.conf configuration values |
| `pgbouncer` | [Pgbouncer](#pgbouncer) | no | PGBouncer connection pooling settings |
| `pglookout` | [Pglookout](#pglookout) | no | PGLookout settings |
| `timescaledb` | [Timescaledb](#timescaledb) | no | TimescaleDB extension configuration values |

### PG {#pg}

postgresql.conf configuration values

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `additionalProperties` | boolean | no |  |
| `properties` | object | no |  |
| `title` | string | no |  |
| `type` | string | no |  |

### Pglookout {#pglookout}

PGLookout settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `additionalProperties` | boolean | no |  |
| `properties` | object | no |  |
| `title` | string | no |  |
| `type` | string | no |  |

### Pgbouncer {#pgbouncer}

PGBouncer connection pooling settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `additionalProperties` | boolean | no |  |
| `properties` | object | no |  |
| `title` | string | no |  |
| `type` | string | no |  |

### Timescaledb {#timescaledb}

TimescaleDB extension configuration values

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `additionalProperties` | boolean | no |  |
| `properties` | object | no |  |
| `title` | string | no |  |
| `type` | string | no |  |

SDK reference for `get-dbaas-settings-pg`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetDBAASSettingsPG) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_dbaas_settings_pg) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getDbaasSettingsPg())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-dbaas-settings-pg`


