> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> System table containing information about existing constraints in all tables.

# system.constraints

<h2 id="description">
  Description
</h2>

Contains information about existing constraints in all tables.

Constraints defined on [temporary tables](/reference/statements/create/table#temporary-tables) are visible in `system.constraints` only in the session where they were created. They are shown with an empty `database` field.

<h2 id="columns">
  Columns
</h2>

* `database` ([String](/reference/data-types)) — Database name.
* `table` ([String](/reference/data-types)) — Table name.
* `name` ([String](/reference/data-types)) — Constraint name.
* `type` ([Enum8('CHECK' = 0, 'ASSUME' = 1)](/reference/data-types)) — Constraint type.
* `expression` ([String](/reference/data-types)) — Constraint expression.

<h2 id="example">
  Example
</h2>

```sql theme={null}
SELECT * FROM system.constraints LIMIT 2 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
database:    default
table:       hits
name:        check_hits
type:        CHECK
expression:  CounterID > 0

Row 2:
──────
database:    default
table:       hits
name:        assume_positive
type:        ASSUME
expression:  WatchID > 0
```
