@supabase/server - v1.9.1
    Preparing search index...

    Class PostgresPoolError

    Thrown when the Postgres pool cannot hand a query a connection: every pooled connection stayed busy for the whole checkout wait, or new connection attempts are paused after one failed.

    Always has status: 503. Both conditions are transient, so the request can be retried. details.retryAfterMs gives the time left when a pause is running.

    ctx.postgres and ctx.postgresAdmin throw this from the query call. The middleware do not turn it into a response; the handler or the host's error handler decides how the request answers.

    import { PostgresPoolError } from '@supabase/server'

    try {
    return Response.json(await ctx.postgres.query`select * from notes`)
    } catch (e) {
    if (e instanceof PostgresPoolError) {
    const retryAfterMs = Number(e.details?.retryAfterMs ?? 1000)
    return Response.json(e.toJSON(), {
    status: e.status,
    headers: { 'Retry-After': String(Math.ceil(retryAfterMs / 1000)) },
    })
    }
    throw e
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    source: "@supabase/server" = ErrorSource

    Always "@supabase/server".

    code: string

    Machine-readable error code.

    hint?: string

    Actionable next step, when one applies.

    docs: string

    Documentation URL for this error's code.

    details?: Record<string, unknown>

    Structured, non-sensitive diagnostics — accepted auth modes, which credential headers were present, configured key names, JWT header fields. Never key values or token payloads.

    status: 503

    Always 503. Nothing about the request is wrong; the pool has no connection for it yet.

    Methods