Connection Pools
Connection pools provide efficient connection management for PostgreSQL databases by maintaining a pool of reusable connections, reducing connection overhead and improving application performance.
Connection pooling is available for PostgreSQL Managed Databases only.
List connection pools
Returns a list of connection pools for a PostgreSQL Managed Database.
Request
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/pools \
-u your_username:your_password
Get pool details
Returns details of a specific connection pool.
Request
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/pools/app-pool \
-u your_username:your_password
Create connection pool
Creates a new connection pool for a PostgreSQL Managed Database.
Attributes
- Name
name- Type
- string
- Description
Pool name (1-64 chars). Required.
- Name
database- Type
- string
- Description
Target database name. Required.
- Name
username- Type
- string
- Description
Database username for pool connections. Required.
- Name
mode- Type
- string
- Description
Pooling mode: "session", "transaction", or "statement". Default: "transaction".
- Name
size- Type
- integer
- Description
Pool size (1-200). Default: 20.
Pooling modes
- Name
session- Description
Server assigned for the full client session lifetime.
- Name
transaction- Description
Server assigned for the transaction duration. Recommended for most applications.
- Name
statement- Description
Server returns to pool after each statement. Requires autocommit.
Request
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/pools \
-u your_username:your_password \
-H "Content-Type: application/json" \
-d '{
"name": "app-pool",
"database": "defaultdb",
"username": "upadmin",
"mode": "transaction",
"size": 25
}'
Modify connection pool
Modifies an existing connection pool configuration.
Attributes
- Name
database- Type
- string
- Description
Target database name.
- Name
username- Type
- string
- Description
Database username for pool connections.
- Name
mode- Type
- string
- Description
Pooling mode: "session", "transaction", or "statement".
- Name
size- Type
- integer
- Description
Pool size (1-200).
Request
curl -X PATCH https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/pools/app-pool \
-u your_username:your_password \
-H "Content-Type: application/json" \
-d '{
"size": 50,
"mode": "session"
}'
Delete connection pool
Deletes a connection pool.
Request
curl -X DELETE https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/pools/app-pool \
-u your_username:your_password