Skip to main content
GET
List Postgres blocking queries
Beta This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future.

Returns which queries waited on locks held by other queries on a Postgres service during the given time window. Each item groups one waiting query with one direct blocker, most-sampled first. Groups come only from periods when blocking query collection was on for the service; turn it on in the console. Results are paginated with limit/offset and include totalCount. The time range must not exceed 31 days, and to_date must be after from_date.

Permission

The API key must have the control-plane:postgres-service:view permission.

Authorizations

Authorization
string
header
required

Use key ID and key secret obtained in ClickHouse Cloud console: https://clickhouse.com/docs/cloud/manage/openapi

Path Parameters

organizationId
string<uuid>
required

ID of the organization that owns the Postgres service.

postgresId
string<uuid>
required

ID of the requested Postgres service.

Query Parameters

from_date
string<date-time>
required

Inclusive start of the time window (RFC 3339 date-time).

to_date
string<date-time>
required

Inclusive end of the time window (RFC 3339 date-time).

db_name
string

Filter to groups whose waiting sessions used this database.

db_user
string

Filter to groups whose waiting sessions ran as this database user.

app
string

Filter to groups whose waiting sessions had this application_name. An empty value matches sessions with no application name.

limit
integer
default:50

Maximum number of results to return.

Required range: 1 <= x <= 2000
offset
integer
default:0

Number of results to skip before returning.

Required range: x >= 0

Response

Successful response

status
number

HTTP status code.

Example:

200

requestId
string<uuid>

Unique id assigned to every request. UUIDv4

result
object[]