--- machine_translated: true machine_translated_rev: d734a8e46ddd7465886ba4133bff743c55190626 toc_priority: 62 toc_title: "\u8A2D\u5B9A\u306E\u5236\u7D04" --- # 設定の制約 {#constraints-on-settings} 設定に関する制約は、次のように定義できます。 `profiles` のセクション `user.xml` 設定ファイルおよびユーザーが設定の一部を変更することを禁止します。 `SET` クエリ。 制約は次のように定義されます: ``` xml lower_boundary upper_boundary lower_boundary upper_boundary ``` ユーザーが制約に違反しようとすると、例外がスローされ、設定は変更されません。 サポートされている制約は次の三種類です: `min`, `max`, `readonly`. その `min` と `max` 制約は数値設定の上限と下限を指定し、組み合わせて使用できます。 その `readonly` 制約を指定すると、ユーザーは変更できませんので、対応する設定です。 **例えば:** さあ `users.xml` 行を含む: ``` xml 10000000000 0 ... 5000000000 20000000000 ``` 以下のクエリすべての例外をスロー: ``` sql SET max_memory_usage=20000000001; SET max_memory_usage=4999999999; SET force_index_by_date=1; ``` ``` text Code: 452, e.displayText() = DB::Exception: Setting max_memory_usage should not be greater than 20000000000. Code: 452, e.displayText() = DB::Exception: Setting max_memory_usage should not be less than 5000000000. Code: 452, e.displayText() = DB::Exception: Setting force_index_by_date should not be changed. ``` **メモ:** その `default` プロファイルには特別な処理があります。 `default` プロファイルはデフォルトの制約になるため、すべてのユーザーを明示的に上書きするまで制限します。 [元の記事](https://clickhouse.tech/docs/en/operations/settings/constraints_on_settings/)