> ## 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.

> SET ROLE에 대한 문서

# SET ROLE 문

현재 사용자에게 할당된 역할을 활성화합니다.

```sql theme={null}
SET ROLE {DEFAULT | NONE | role [,...] | ALL | ALL EXCEPT role [,...]}
```

<div id="set-default-role">
  ## SET DEFAULT ROLE
</div>

사용자의 기본 역할을 설정합니다.

기본 역할은 사용자가 로그인할 때 자동으로 활성화됩니다. 기본 역할로는 이전에 부여된 역할만 설정할 수 있습니다. 역할이 사용자에게 부여되지 않은 경우 ClickHouse는 예외를 발생시킵니다.

```sql theme={null}
SET DEFAULT ROLE {NONE | role [,...] | ALL | ALL EXCEPT role [,...]} TO {user|CURRENT_USER} [,...]
```

<div id="examples">
  ## 예시
</div>

사용자에게 여러 개의 기본 역할을 설정합니다:

```sql theme={null}
SET DEFAULT ROLE role1, role2, ... TO user
```

사용자에게 부여된 모든 역할을 기본 역할로 설정합니다:

```sql theme={null}
SET DEFAULT ROLE ALL TO user
```

사용자의 기본 역할 제거:

```sql theme={null}
SET DEFAULT ROLE NONE TO user
```

특정 역할 `role1` 및 `role2`를 제외한 부여된 모든 역할을 기본 역할로 설정합니다:

```sql theme={null}
SET DEFAULT ROLE ALL EXCEPT role1, role2 TO user
```
