

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 Python UDF。现有的 Python UDF 将继续正常运行至 2026 年 6 月 30 日。有关更多信息，请参阅[博客文章](https://www.amazonaws.cn/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# SVV\_ALL\_COLUMNS
<a name="r_SVV_ALL_COLUMNS"></a>

使用 SVV\_ALL\_COLUMNS 可以查看来自 Amazon Redshift 表的列的联合，如 SVV\_REDSHIFT\_COLUMNS 中所示，以及所有外部表中所有外部列的合并列表。有关 Amazon Redshift 列的信息，请参阅[SVV\_REDSHIFT\_COLUMNS](r_SVV_REDSHIFT_COLUMNS.md)。

SVV\_ALL\_COLUMNS 对所有用户可见。超级用户可以查看所有行；普通用户只能查看其自己的数据。有关更多信息，请参阅 [系统表和视图中的数据可见性](cm_chap_system-tables.md#c_visibility-of-data)。

## 表列
<a name="r_SVV_ALL_COLUMNS-table-columns"></a>


| 列名称  | 数据类型  | 描述  | 
| --- | --- | --- | 
| database\_name | varchar(128) | 数据库的名称。 | 
| schema\_name | varchar(128) | 架构的名称。 | 
| table\_name | varchar(128) | 表的名称。 | 
| column\_name | varchar(128) | 列的名称。 | 
| ordinal\_position | integer | 列在表中的位置。 | 
| column\_default | varchar(4000) | 列的默认值。 | 
| is\_nullable | varchar(3) | 指示列是否可为 null 的值。可能的值为 yes 和 no。 | 
| data\_type | varchar(128) | 列的数据类型。 | 
| character\_maximum\_length | integer | 列中的最大字符数。 | 
| numeric\_precision | integer | 数值精度。 | 
| numeric\_scale | integer | 小数位数。 | 
| remarks | varchar(256) | 备注。 | 

## 示例查询
<a name="r_SVV_ALL_COLUMNS-sample-queries"></a>

下面的示例返回 SVV\_ALL\_COLUMNS 的输出。

```
SELECT *
FROM svv_all_columns
WHERE database_name = 'tickit_db'
    AND TABLE_NAME = 'tickit_sales_redshift'
ORDER BY COLUMN_NAME,
    SCHEMA_NAME
LIMIT 5;

 database_name | schema_name |     table_name        | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | numeric_precision | numeric_scale | remarks
 --------------+-------------+-----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+-------------------+---------------+---------
   tickit_db   |    public   | tickit_sales_redshift |    buyerid  |        4         |                |      NO     |  integer  |                          |         32        |       0       |
   tickit_db   |    public   | tickit_sales_redshift | commission  |        9         |                |     YES     |  numeric  |                          |          8        |	2       |
   tickit_db   |    public   | tickit_sales_redshift |    dateid   |        7         |                |      NO     |  smallint |                          |         16        |       0       |
   tickit_db   |    public   | tickit_sales_redshift |   eventid   |        5         |                |      NO     |  integer  |                          |         32        |       0       |
   tickit_db   |    public   | tickit_sales_redshift |    listid   |        2         |                |      NO     |  integer  |                          |         32        |       0       |
```