# DBaaS Service PG

## Properties

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | Service name<br/><br/>Min length: `0`. Max length: `63`. |
| `plan` | string | **yes** | Subscription plan |
| `prometheus-uri` | [Prometheus URI](/reference/api/_schemas/dbaas-service-pg/#prometheus-uri) | **yes** | Prometheus integration URI |
| `type` | string | **yes** | Service type code<br/><br/>Min length: `0`. Max length: `64`. |
| `backup-schedule` | [Backup Schedule](/reference/api/_schemas/dbaas-service-pg/#backup-schedule) | no | Backup schedule |
| `backups` | array of [List of backups for the service](/reference/api/_schemas/dbaas-service-backup/) | no | List of backups for the service |
| `components` | array of [Components](/reference/api/_schemas/dbaas-service-pg/#components) | no | Service component information objects |
| `connection-info` | [Connection Info](/reference/api/_schemas/dbaas-service-pg/#connection-info) | no | PG connection information properties |
| `connection-pools` | array of [Connection Pools](/reference/api/_schemas/dbaas-service-pg/#connection-pools) | no | PostgreSQL PGBouncer connection pools |
| `created-at` | string | no | Service creation timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `databases` | array of [DBaaS Database Name](/reference/api/_schemas/dbaas-database-name/) | no | List of PostgreSQL databases |
| `disk-size` | integer | no | TODO UNIT disk space for data storage<br/><br/>Min: `0`. |
| `integrations` | array of [DBaaS Integration](/reference/api/_schemas/dbaas-integration/) | no | Service integrations |
| `ip-filter` | array[string] | no | Allowed CIDR address blocks for incoming connections |
| `maintenance` | [Automatic maintenance settings](/reference/api/_schemas/dbaas-service-maintenance/) | no | Automatic maintenance settings |
| `max-connections` | integer | no | Maximum number of connections allowed to an instance<br/><br/>Min: `0`. |
| `node-count` | integer | no | Number of service nodes in the active plan<br/><br/>Min: `0`. |
| `node-cpu-count` | integer | no | Number of CPUs for each node<br/><br/>Min: `0`. |
| `node-memory` | integer | no | TODO UNIT of memory for each node<br/><br/>Min: `0`. |
| `node-states` | array of [Automatic maintenance settings](/reference/api/_schemas/dbaas-node-state/) | no | State of individual service nodes |
| `notifications` | array of [Service notifications](/reference/api/_schemas/dbaas-service-notification/) | no | Service notifications |
| `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 |
| `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`. |
| `state` | string | no | State of the service<br/><br/>Allowed values: `running`, `rebuilding`, `rebalancing`, `poweroff`. |
| `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 |
| `updated-at` | string | no | Service last update timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `uri` | string | no | URI for connecting to the service (may be absent) |
| `uri-params` | object | no | service_uri parameterized into key-value pairs |
| `users` | array of [Users](/reference/api/_schemas/dbaas-service-pg/#users) | no | List of service users |
| `version` | string | no | PostgreSQL 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`. |
| `zone` | string | no | The zone where the service is running |

### Connection Info {#connection-info}

PG connection information properties

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | array of [Params](/reference/api/_schemas/dbaas-service-pg/#params) | no |  |
| `standby` | array[string] | no |  |
| `syncing` | array[string] | no |  |
| `uri` | array[string] | no |  |

### Backup Schedule {#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`. |

### Prometheus URI {#prometheus-uri}

Prometheus integration URI

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `host` | string | no |  |
| `port` | integer | no | Min: `0`. Max: `65535`. |

### Connection Pools {#connection-pools}

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

### Components {#components}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `component` | string | **yes** | Service component name |
| `host` | string | **yes** | DNS name for connecting to the service component |
| `port` | integer | **yes** | Port number for connecting to the service component<br/><br/>Min: `0`. Max: `65535`. |
| `route` | string | **yes** | Network access route<br/><br/>Allowed values: `dynamic`, `private`, `public`, `privatelink`. |
| `usage` | string | **yes** | DNS usage name<br/><br/>Allowed values: `primary`, `replica`. |

### Users {#users}

List of service users

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string | **yes** | Account type |
| `username` | string | **yes** | Account username |
| `allow-replication` | boolean | no |  |
| `password` | string | no | Account password. A missing field indicates a user overridden password. |

