Skip to main content

configs

Creates, updates, deletes, gets or lists a configs resource.

Overview

Nameconfigs
TypeResource
Idclickhouse.postgres.configs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
pg_bouncer_configobjectPgBouncer [runtime configuration](https:​//www.pgbouncer.org/config.html) configuration. (title: PgBouncer Configuration) (wire: pgBouncerConfig)
pg_configobjectPostgres [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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpostgres_id, organization_idThis 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.
createinsertpostgres_id, organization_id, pg_config, pg_bouncer_configThis 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.
updateupdatepostgres_id, organization_id, pg_config, pg_bouncer_configThis 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.

NameDatatypeDescription
organization_idstringClickHouse 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_idstring (uuid)ID of the requested Postgres service. (wire: postgresId)

SELECT examples

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

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
;

UPDATE examples

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;