> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dbhost.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Query timeout defaults

> Read and change bounded PostgreSQL defaults for new database sessions.

`GET /api/v1/databases/{id}/query-timeouts` returns the exact native database
OID, current catalog-backed timeout values, the desired and effective profile,
operation status, generation, and policy version. `not_configured` means DBHost
has not selected a database profile; it does not imply unlimited queries for
every role. The response reports when some roles have their own overrides.

| Profile | Statement | Lock wait | Idle in transaction |
| - | -: | -: | -: |
| `standard` | 60 s | 10 s | 30 s |
| `balanced` | 30 s | 3 s | 15 s |
| `short` | 15 s | 1 s | 5 s |

An account owner can select one supported profile with an API key authorized
to change that database:

```http theme={null}
POST /api/v1/databases/{id}/query-timeouts
Authorization: Bearer <api-key>
Idempotency-Key: <stable-unique-key>
Content-Type: application/json

{"profile":"balanced"}
```

Reuse the same idempotency key after a timeout or uncertain response. An open
change blocks a second request and database lifecycle work until it is
reconciled. The profile sets database defaults and the owner login's
database-specific defaults. PgBouncer reconnects server sessions after their
current transactions; already running transactions are not interrupted.
Customer-created role-specific overrides are preserved and may produce a
different effective setting for those roles. These defaults are not hard CPU,
RAM or disk quotas.

The older clone route returns `409 QUERY_TIMEOUT_CLONE_REQUIRES_RECONFIGURATION`
for a database with a saved timeout profile. A clone needs independent
admission and a verified target profile; DBHost does not silently copy the
source profile. Same-identity restore keeps the profile after native
readback and rebinds its physical database OID.

The dashboard has the same profile selector with one confirmation. The CLI
uses `dbhost databases timeouts <id>` and
`dbhost databases timeouts-set <id> <standard|balanced|short> --idempotency-key KEY`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.