# Public Cloud › Databases › PostgreSQL › Pools API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 6 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/databases/postgresql/pools.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/databases/postgresql/pools.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool` — List connection pools
- `GET /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}` — Get a connection pool
- `POST /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool` — Create a connection pool
- `DELETE /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}` — Delete a connection pool
- `PUT /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}` — Update a connection pool
- `PATCH /publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}` — Partially update a connection pool

## List connection pools

`GET /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#get-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/get`

Returns the connection pools of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "databaseId": "00000000-0000-0000-0000-000000000000",
    "id": "00000000-0000-0000-0000-000000000000",
    "mode": "SESSION",
    "name": "string",
    "port": 0,
    "size": 0,
    "sslMode": "REQUIRE",
    "updatedAt": "2024-01-01T12:00:00Z",
    "uri": "string",
    "userId": "00000000-0000-0000-0000-000000000000"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool");

print_r($result);
?>
```

## Get a connection pool

`GET /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#get-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool-connectionpoolid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/get`

Returns the connection pool settings and its connection URI.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionPoolId` | path | string (uuid) | yes | Connection pool ID |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "port": 0,
  "size": 0,
  "sslMode": "REQUIRE",
  "updatedAt": "2024-01-01T12:00:00Z",
  "uri": "string",
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}");

print_r($result);
?>
```

## Create a connection pool

`POST /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#post-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/create`

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.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.postgresql.ConnectionPoolCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseId` | string (uuid) | yes | Identifier of the target database schema |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | yes | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | yes | Name of the connection pool |
| `size` | integer | yes | Maximum number of server connections in the pool |
| `userId` | string (uuid) |  | Unique identifier of the database user for server connections. Null to use a system user. |

```json
{
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "size": 0,
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "port": 0,
  "size": 0,
  "sslMode": "REQUIRE",
  "updatedAt": "2024-01-01T12:00:00Z",
  "uri": "string",
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.database.postgresql.ConnectionPoolCreation
result = client.post("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool",
	databaseId = None, # Identifier of the target database schema (type: string)
	mode = None, # PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum)
	name = None, # Name of the connection pool (type: string)
	size = None, # Maximum number of server connections in the pool (type: integer)
	userId = None, # Unique identifier of the database user for server connections. Null to use a system user. (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.database.postgresql.ConnectionPoolCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool", array(
	databaseId => null, // Identifier of the target database schema (type: string)
	mode => null, // PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum)
	name => null, // Name of the connection pool (type: string)
	size => null, // Maximum number of server connections in the pool (type: integer)
	userId => null, // Unique identifier of the database user for server connections. Null to use a system user. (type: string, nullable)
));

print_r($result);
?>
```

## Delete a connection pool

`DELETE /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#delete-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool-connectionpoolid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/delete`

Deletes the connection pool.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionPoolId` | path | string (uuid) | yes | Connection pool ID |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "port": 0,
  "size": 0,
  "sslMode": "REQUIRE",
  "updatedAt": "2024-01-01T12:00:00Z",
  "uri": "string",
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}");

print_r($result);
?>
```

## Update a connection pool

`PUT /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#put-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool-connectionpoolid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/edit`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionPoolId` | path | string (uuid) | yes | Connection pool ID |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.postgresql.ConnectionPoolReplace`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseId` | string (uuid) | yes | Identifier of the target database schema |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | yes | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `size` | integer | yes | Maximum number of server connections in the pool |
| `userId` | string (uuid) | yes | Unique identifier of the database user for server connections. Null to remove the user assignment. |

```json
{
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "size": 0,
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "port": 0,
  "size": 0,
  "sslMode": "REQUIRE",
  "updatedAt": "2024-01-01T12:00:00Z",
  "uri": "string",
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.database.postgresql.ConnectionPoolReplace
result = client.put("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}",
	databaseId = None, # Identifier of the target database schema (type: string)
	mode = None, # PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum)
	size = None, # Maximum number of server connections in the pool (type: integer)
	userId = None, # Unique identifier of the database user for server connections. Null to remove the user assignment. (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.database.postgresql.ConnectionPoolReplace
$result = $ovh->put("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}", array(
	databaseId => null, // Identifier of the target database schema (type: string)
	mode => null, // PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum)
	size => null, // Maximum number of server connections in the pool (type: integer)
	userId => null, // Unique identifier of the database user for server connections. Null to remove the user assignment. (type: string, nullable)
));

print_r($result);
?>
```

## Partially update a connection pool

`PATCH /v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/databases/postgresql/pools/#patch-publiccloud-project-projectid-manageddatabase-postgresql-serviceid-connectionpool-connectionpoolid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:database/postgresql/connectionPool/edit`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `connectionPoolId` | path | string (uuid) | yes | Connection pool ID |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.postgresql.ConnectionPoolUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseId` | string (uuid) |  | Identifier of the target database schema |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum |  | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `size` | integer |  | Maximum number of server connections in the pool |
| `userId` | string (uuid) |  | Unique identifier of the database user for server connections. Null to remove the user assignment. |

```json
{
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "size": 0,
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.postgresql.ConnectionPool | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `databaseId` | string (uuid) | read-only | Identifier of the target database schema |
| `id` | string (uuid) | read-only | Unique identifier of the connection pool |
| `mode` | publicCloud.database.postgresql.ConnectionPoolModeEnum | read-only | PgBouncer pooling mode — one of `SESSION`, `STATEMENT`, `TRANSACTION` |
| `name` | string | read-only | Name of the connection pool |
| `port` | integer | read-only | TCP port on which the connection pool listens |
| `size` | integer | read-only | Maximum number of server connections in the pool |
| `sslMode` | publicCloud.database.SSLModeEnum | read-only | SSL connection mode for the pool — one of `REQUIRE` |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |
| `uri` | string | read-only | Connection URI to the pool |
| `userId` | string (uuid) | read-only | Unique identifier of the database user used to establish server connections. Null when no user is assigned. |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "databaseId": "00000000-0000-0000-0000-000000000000",
  "id": "00000000-0000-0000-0000-000000000000",
  "mode": "SESSION",
  "name": "string",
  "port": 0,
  "size": 0,
  "sslMode": "REQUIRE",
  "updatedAt": "2024-01-01T12:00:00Z",
  "uri": "string",
  "userId": "00000000-0000-0000-0000-000000000000"
}
```

### Example

```bash
curl -X PATCH \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.database.postgresql.ConnectionPoolUpdate
result = client.patch("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}",
	databaseId = None, # Identifier of the target database schema (type: string, nullable)
	mode = None, # PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum, nullable)
	size = None, # Maximum number of server connections in the pool (type: integer, nullable)
	userId = None, # Unique identifier of the database user for server connections. Null to remove the user assignment. (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.database.postgresql.ConnectionPoolUpdate
$result = $ovh->patch("/v2/publicCloud/project/{projectId}/managedDatabase/postgresql/{serviceId}/connectionPool/{connectionPoolId}", array(
	databaseId => null, // Identifier of the target database schema (type: string, nullable)
	mode => null, // PgBouncer pooling mode (type: publicCloud.database.postgresql.ConnectionPoolModeEnum, nullable)
	size => null, // Maximum number of server connections in the pool (type: integer, nullable)
	userId => null, // Unique identifier of the database user for server connections. Null to remove the user assignment. (type: string, nullable)
));

print_r($result);
?>
```
