Database

Error codes

Database error statuses, PostgREST codes and retryability.

Management endpoints return domain codes; both table endpoints return PostgREST codes. HTTP status and retryability are listed below.

Domain codeHTTPPostgREST codeRetryable
SINGULAR_MISMATCH406PGRST116no
AMBIGUOUS_EMBED300PGRST201no
EMBED_NOT_FOUND400PGRST200no
INVALID_PREFERENCE400PGRST122no
QUERY_CANCELED50057014no
RANGE_NOT_SATISFIABLE416PGRST103no
NOT_ACCEPTABLE406PGRST107no
OPERATOR_TYPE_MISMATCH40042883no
DATABASE_NOT_FOUND404PGRST125no
TABLE_NOT_FOUND404PGRST205no
FIELD_NOT_FOUND40042703no
VALIDATION_FAILED40023514no
UNIQUE_VIOLATION40923505no
REFERENCE_RESTRICT40923503no
FIELD_TYPE_IMMUTABLE400—no
LIMIT_EXCEEDED40054000no
UNSUPPORTED400PGRST127no
INVALID_PARAMS400PGRST100no
DATABASE_INVALID_STATE409—no
CAPACITY503—yes
NOT_IMPLEMENTED501PGRST127no

Retryable does not mean repeating the same request will succeed. For 57014, narrow the query or change its filters before retrying.

Management endpoint error body

Response example — HTTP 400

{
  "code": "FIELD_TYPE_IMMUTABLE",
  "message": "field type is immutable",
  "details": null,
  "hint": null
}

Table endpoint error body

Response example — HTTP 400

{
  "code": "PGRST127",
  "message": "operator fts is not supported",
  "details": null,
  "hint": null
}

The code, message, details and hint fields are always present; details and hint can be null.

Unavailable service error body

Response example — HTTP 501

HeaderValue
x-should-retryfalse
{
  "code": "not_implemented",
  "message": "auth is not provided by praxis-database"
}

These five services return not_implemented directly; this differs from the NOT_IMPLEMENTED domain code in the table.

Correct the request using error details

Only id is a reserved field name. New field names cannot start with _, which is reserved for system metadata. created_at, updated_at and version are ordinary user field names. Datetime fields can use "now()" as a default.

details identifies the field or JSON path and the received value. Batch validation includes a zero-based row index. Values are limited to 80 characters; the entire row is never echoed. hint suggests a correction, or is null when no suggestion applies. This example omits the required title in row 2:

{
  "code": "23514",
  "message": "row validation failed",
  "details": "row 1: title: required value (got null)",
  "hint": "Rows in one insert are filled to the union of their keys with null (PostgREST behavior). Send every key in every row, or send Prefer: missing=default to use field defaults."
}

A unique conflict returns 409, for example:

{
  "code": "23505",
  "message": "unique constraint violated",
  "details": "Key (email)=(a@b.c) already exists.",
  "hint": null
}
Export

On this page