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

> すべてのテーブルに存在する制約の情報を含むシステムテーブル。

# system.constraints

<div id="description">
  ## 説明
</div>

すべてのテーブルに存在する制約に関する情報が含まれます。

[一時テーブル](/ja/reference/statements/create/table#temporary-tables) に定義された制約は、作成されたセッションでのみ `system.constraints` に表示されます。これらは `database` フィールドが空の状態で表示されます。

<div id="columns">
  ## カラム
</div>

* `database` ([String](/ja/reference/data-types/index)) — データベース名。
* `table` ([String](/ja/reference/data-types/index)) — テーブル名。
* `name` ([String](/ja/reference/data-types/index)) — 制約名。
* `type` ([Enum8('CHECK' = 0, 'ASSUME' = 1)](/ja/reference/data-types/index)) — 制約のタイプ。
* `expression` ([String](/ja/reference/data-types/index)) — 制約式。

<div id="example">
  ## 例
</div>

```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
```
