

 Amazon Redshift 將不再支援從修補程式 198 開始建立新的 Python UDFs。現有 Python UDF 將繼續正常運作至 2026 年 6 月 30 日。如需詳細資訊，請參閱[部落格文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# DROP GROUP
<a name="r_DROP_GROUP"></a>

刪除使用者群組。此命令無法還原。此命令不會刪除群組中的個別使用者。

請參閱 DROP USER 以刪除個別使用者。

## 語法
<a name="r_DROP_GROUP-synopsis"></a>

```
DROP GROUP name
```

## 參數
<a name="r_DROP_GROUP-parameter"></a>

 *name*   
要刪除的使用者群組名稱。

## 範例
<a name="r_DROP_GROUP-example"></a>

以下範例會刪除 `guests` 使用者群組：

```
DROP GROUP guests;
```

如果群組有物件上的任何權限，則您無法捨棄群組。如果您嘗試捨棄這類群組，則會收到下列錯誤。

```
ERROR: group "guests" can't be dropped because the group has a privilege on some object
```

如果群組具有物件的權限，則您必須先撤銷權限，再捨棄群組。若要尋找 `guests` 群組具有其權限的物件，請使用下列範例。如需範例中所使用中繼資料檢視的詳細資訊，請參閱 [SVV\_RELATION\_PRIVILEGES](https://docs.aws.amazon.com//redshift/latest/dg/r_SVV_RELATION_PRIVILEGES.html)。

```
SELECT DISTINCT namespace_name, relation_name, identity_name, identity_type 
FROM svv_relation_privileges
WHERE identity_type='group' AND identity_name='guests';

+----------------+---------------+---------------+---------------+
| namespace_name | relation_name | identity_name | identity_type |
+----------------+---------------+---------------+---------------+
| public         | table1        | guests        | group         |
+----------------+---------------+---------------+---------------+
| public         | table2        | guests        | group         |
+----------------+---------------+---------------+---------------+
```

下列範例會撤銷 `public` 使用者群組的 `guests` 結構描述中所有資料表的所有權限，然後捨棄群組。

```
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM GROUP guests;
DROP GROUP guests;
```