configs
Creates, updates, deletes, gets or lists a configs resource.
Overview
| Name | configs |
| Type | Resource |
| Id | clickhouse.postgres.configs |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
pg_bouncer_config | object | PgBouncer [runtime configuration](https://www.pgbouncer.org/config.html) configuration. (title: PgBouncer Configuration) (wire: pgBouncerConfig) |
pg_config | object | Postgres [runtime configuration](https://www.postgresql.org/docs/current/runtime-config.html) configuration. (title: Postgres Configuration) (wire: pgConfig) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | postgres_id, organization_id | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns the configuration data for a Postgres service and its PgBouncer service. | |
create | insert | postgres_id, organization_id, pg_config, pg_bouncer_config | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Replace the existing Postgres service and pgBouncer configuration. | |
update | update | postgres_id, organization_id, pg_config, pg_bouncer_config | This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Update the existing Postgres service and pgBouncer configuration. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
organization_id | string | ClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID) |
postgres_id | string (uuid) | ID of the requested Postgres service. (wire: postgresId) |
SELECT examples
- get
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns the configuration data for a Postgres service and its PgBouncer service.
SELECT
pg_bouncer_config,
pg_config
FROM clickhouse.postgres.configs
WHERE postgres_id = '{{ postgres_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
INSERT examples
- create
- Manifest
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Replace the existing Postgres service and pgBouncer configuration.
INSERT INTO clickhouse.postgres.configs (
pg_config,
pg_bouncer_config,
postgres_id,
organization_id
)
SELECT
'{{ pg_config }}' /* required */,
'{{ pg_bouncer_config }}' /* required */,
'{{ postgres_id }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;
# Description fields are for documentation purposes
- name: configs
props:
- name: postgres_id
value: "{{ postgres_id }}"
description: Required parameter for the configs resource.
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the configs resource.
- name: pg_config
description: |
Postgres [runtime configuration](https://www.postgresql.org/docs/current/runtime-config.html) configuration.
value:
max_connections: "{{ max_connections }}"
default_transaction_isolation: "{{ default_transaction_isolation }}"
ssl_min_protocol_version: "{{ ssl_min_protocol_version }}"
maintenance_work_mem: "{{ maintenance_work_mem }}"
work_mem: "{{ work_mem }}"
effective_cache_size: "{{ effective_cache_size }}"
random_page_cost: "{{ random_page_cost }}"
effective_io_concurrency: "{{ effective_io_concurrency }}"
max_worker_processes: "{{ max_worker_processes }}"
max_parallel_workers: "{{ max_parallel_workers }}"
max_parallel_workers_per_gather: "{{ max_parallel_workers_per_gather }}"
max_parallel_maintenance_workers: "{{ max_parallel_maintenance_workers }}"
statement_timeout: "{{ statement_timeout }}"
lock_timeout: "{{ lock_timeout }}"
idle_session_timeout: "{{ idle_session_timeout }}"
idle_in_transaction_session_timeout: "{{ idle_in_transaction_session_timeout }}"
transaction_timeout: "{{ transaction_timeout }}"
wal_sender_timeout: "{{ wal_sender_timeout }}"
wal_keep_size: "{{ wal_keep_size }}"
min_wal_size: "{{ min_wal_size }}"
max_wal_size: "{{ max_wal_size }}"
max_slot_wal_keep_size: "{{ max_slot_wal_keep_size }}"
wal_compression: "{{ wal_compression }}"
autovacuum_max_workers: "{{ autovacuum_max_workers }}"
autovacuum_naptime: "{{ autovacuum_naptime }}"
autovacuum_work_mem: "{{ autovacuum_work_mem }}"
autovacuum_vacuum_scale_factor: "{{ autovacuum_vacuum_scale_factor }}"
autovacuum_analyze_scale_factor: "{{ autovacuum_analyze_scale_factor }}"
autovacuum_vacuum_insert_scale_factor: "{{ autovacuum_vacuum_insert_scale_factor }}"
autovacuum_vacuum_cost_limit: "{{ autovacuum_vacuum_cost_limit }}"
autovacuum_vacuum_cost_delay: "{{ autovacuum_vacuum_cost_delay }}"
- name: pg_bouncer_config
value: "{{ pg_bouncer_config }}"
description: |
PgBouncer [runtime configuration](https://www.pgbouncer.org/config.html) configuration.
UPDATE examples
- update
This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> Update the existing Postgres service and pgBouncer configuration.
UPDATE clickhouse.postgres.configs
SET
pg_config = '{{ pg_config }}',
pg_bouncer_config = '{{ pg_bouncer_config }}'
WHERE
postgres_id = '{{ postgres_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
AND pg_config = '{{ pg_config }}' --required
AND pg_bouncer_config = '{{ pg_bouncer_config }}' --required
RETURNING
request_id,
result,
status;