Skip to main content

postgresql_connection_pools

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

Overview​

Namepostgresql_connection_pools
TypeResource
Idovh.public_cloud_database.postgresql_connection_pools

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the connection pool
namestringName of the connection pool
database_idstring (uuid)Identifier of the target database schema (wire: databaseId)
user_idstring (uuid)Unique identifier of the database user used to establish server connections. Null when no user is assigned. (wire: userId)
checksumstringHash of the resource used for concurrency control
created_atstring (date-time)Date at which the resource was created (wire: createdAt)
modestringPgBouncer pooling mode (SESSION, STATEMENT, TRANSACTION)
portintegerTCP port on which the connection pool listens
sizeintegerMaximum number of server connections in the pool
ssl_modestringSSL connection mode for the pool (REQUIRE) (wire: sslMode)
updated_atstring (date-time)Date of the last update to the resource (wire: updatedAt)
uristringConnection URI to the pool

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectconnection_pool_id, service_id, project_idReturns the connection pool settings and its connection URI. (Beta version)
listselectservice_id, project_idx_pagination_cursor, x_pagination_sizeReturns the connection pools of the service. (Beta version)
createinsertservice_id, project_id, database_id, mode, name, sizeCreates a connection pool on a database, with a pooling mode and a maximum number of server connections. Without userId, a system user opens the server connections. (Beta version)
updateupdateconnection_pool_id, service_id, project_idPartially updates the database, pooling mode, size or user of the connection pool. Setting userId to null removes the user assignment. (Beta version)
deletedeleteconnection_pool_id, service_id, project_idDeletes the connection pool. (Beta version)
replaceexecconnectionPoolId, serviceId, project_id, databaseId, mode, size, userIdUpdates the database, pooling mode, size and user of the connection pool. Every field is required. Setting userId to null removes the user assignment. (Beta version)

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
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
connectionPoolIdstring (uuid)Connection pool ID
connection_pool_idstring (uuid)Connection pool ID (wire: connectionPoolId)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
serviceIdstring (uuid)Service ID
service_idstring (uuid)Service ID (wire: serviceId)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the connection pool settings and its connection URI. (Beta version)

SELECT
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri
FROM ovh.public_cloud_database.postgresql_connection_pools
WHERE connection_pool_id = '{{ connection_pool_id }}' -- required
AND service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Creates a connection pool on a database, with a pooling mode and a maximum number of server connections. Without userId, a system user opens the server connections. (Beta version)

INSERT INTO ovh.public_cloud_database.postgresql_connection_pools (
database_id,
mode,
name,
size,
user_id,
service_id,
project_id
)
SELECT
'{{ database_id }}' /* required */,
'{{ mode }}' /* required */,
'{{ name }}' /* required */,
{{ size }} /* required */,
'{{ user_id }}',
'{{ service_id }}',
'{{ project_id }}'
RETURNING
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri
;

UPDATE examples​

Partially updates the database, pooling mode, size or user of the connection pool. Setting userId to null removes the user assignment. (Beta version)

UPDATE ovh.public_cloud_database.postgresql_connection_pools
SET
database_id = '{{ database_id }}',
mode = '{{ mode }}',
size = {{ size }},
user_id = '{{ user_id }}'
WHERE
connection_pool_id = '{{ connection_pool_id }}' --required
AND service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri;

DELETE examples​

Deletes the connection pool. (Beta version)

DELETE FROM ovh.public_cloud_database.postgresql_connection_pools
WHERE connection_pool_id = '{{ connection_pool_id }}' --required
AND service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Updates the database, pooling mode, size and user of the connection pool. Every field is required. Setting userId to null removes the user assignment. (Beta version)

EXEC ovh.public_cloud_database.postgresql_connection_pools.replace
@connectionPoolId='{{ connectionPoolId }}' --required,
@serviceId='{{ serviceId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"databaseId": "{{ databaseId }}",
"mode": "{{ mode }}",
"size": {{ size }},
"userId": "{{ userId }}"
}'
;