

 Amazon Redshift は、パッチ 198 以降、新しい Python UDF の作成をサポートしなくなります。既存の 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/)を参照してください。

# STL\_USERLOG
<a name="r_STL_USERLOG"></a>

データベースユーザーに対する次の変更の詳細を記録します。
+ ユーザーの作成
+ ユーザーの削除
+ ユーザーの変更 (名前の変更)
+ ユーザーの変更 (プロパティの変更)

STL\_USERLOG はスーパーユーザーのみに表示されます。詳細については、「[システムテーブルとビューのデータの可視性](cm_chap_system-tables.md#c_visibility-of-data)」を参照してください。

このテーブルの一部またはすべてのデータは、SYS モニタリングビュー [SYS\_USERLOG](SYS_USERLOG.md) でも確認できます。SYS モニタリングビューのデータは、使いやすく理解しやすいようにフォーマットされます。クエリには、SYS モニタリングビューを使用することをお勧めします。

## テーブルの列
<a name="r_STL_USERLOG-table-columns"></a>


| 列名  | データ型  | 説明  | 
| --- | --- | --- | 
| userid | integer | 変更の影響を受けるユーザーの ID。 | 
| username | character(50) | 変更の影響を受けるユーザーのユーザー名。 | 
| oldusername | character(50) | 名前の変更アクションの場合、以前のユーザー名。その他のアクションの場合、このフィールドは空欄です。 | 
| action | character(10) | 実行されたアクション。有効な値: [See the AWS documentation website for more details](http://docs.aws.amazon.com/ja_jp/redshift/latest/dg/r_STL_USERLOG.html)  | 
| usecreatedb | integer | true (1) の場合、ユーザーに create database 権限があることを示します。 | 
| usesuper | integer | true (1) の場合、ユーザーがスーパーユーザーであることを示します。 | 
| usecatupd | integer | true (1) の場合、ユーザーはシステムカタログを更新できることを示します。 | 
| valuntil | timestamp | パスワードが失効する日付。 | 
| pid | integer | プロセス ID。 | 
| xid | bigint | トランザクション ID。 | 
| recordtime | timestamp | UTC で表されたクエリの開始時間。 | 

## サンプルクエリ
<a name="r_STL_USERLOG-sample-queries"></a>

次の例は、4 つのユーザーアクションを実行してから、STL\_USERLOG ビューをクエリします。

```
create user userlog1 password 'Userlog1';
alter user userlog1 createdb createuser;
alter user userlog1 rename  to userlog2;
drop user userlog2;

select userid, username, oldusername, action, usecreatedb, usesuper from stl_userlog order by recordtime desc;
```

```
 userid |  username | oldusername |  action | usecreatedb | usesuper
--------+-----------+-------------+---------+-------------+----------
    108 | userlog2  |             | drop    |           1 |   1
    108 | userlog2  | userlog1    | rename  |           1 |   1
    108 | userlog1  |             | alter   |           1 |   1
    108 | userlog1  |             | create  |           0 |   0
 (4 rows)
```