

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 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/)。

# PG\$1GET\$1LATE\$1BINDING\$1VIEW\$1COLS
<a name="PG_GET_LATE_BINDING_VIEW_COLS"></a>

返回数据库中所有后期绑定视图的列元数据。有关更多信息，请参阅[后期绑定视图](r_CREATE_VIEW.md#r_CREATE_VIEW_late-binding-views)。

## 语法
<a name="PG_GET_LATE_BINDING_VIEW_COLS-synopsis"></a>

```
pg_get_late_binding_view_cols()
```

## 返回类型
<a name="PG_GET_LATE_BINDING_VIEW_COLS-return-type"></a>

VARCHAR 

## 使用说明
<a name="PG_GET_LATE_BINDING_VIEW_COLS-usage-notes"></a>

`PG_GET_LATE_BINDING_VIEW_COLS` 函数为后期绑定视图中的每个列返回一行内容。该行包含一个逗号分隔列表，其中包括 schema 名称、关系名称、列名、数据类型和列编号。

## 示例
<a name="PG_GET_LATE_BINDING_VIEW_COLS-example"></a>

以下示例返回所有后期绑定视图的列元数据。

```
select pg_get_late_binding_view_cols();

pg_get_late_binding_view_cols                               
------------------------------------------------------------
(public,myevent,eventname,"character varying(200)",1)       
(public,sales_lbv,salesid,integer,1)                        
(public,sales_lbv,listid,integer,2)                         
(public,sales_lbv,sellerid,integer,3)                       
(public,sales_lbv,buyerid,integer,4)                        
(public,sales_lbv,eventid,integer,5)                        
(public,sales_lbv,dateid,smallint,6)                        
(public,sales_lbv,qtysold,smallint,7)                       
(public,sales_lbv,pricepaid,"numeric(8,2)",8)               
(public,sales_lbv,commission,"numeric(8,2)",9)              
(public,sales_lbv,saletime,"timestamp without time zone",10)
(public,event_lbv,eventid,integer,1)                        
(public,event_lbv,venueid,smallint,2)                       
(public,event_lbv,catid,smallint,3)                         
(public,event_lbv,dateid,smallint,4)                        
(public,event_lbv,eventname,"character varying(200)",5)     
(public,event_lbv,starttime,"timestamp without time zone",6)
```

以下示例以表格式返回所有后期绑定视图的列元数据。

```
select * from pg_get_late_binding_view_cols() cols(view_schema name, view_name name, col_name name, col_type varchar, col_num int);
view_schema | view_name | col_name   | col_type                    | col_num
------------+-----------+------------+-----------------------------+--------
public      | sales_lbv | salesid    | integer                     |       1
public      | sales_lbv | listid     | integer                     |       2
public      | sales_lbv | sellerid   | integer                     |       3
public      | sales_lbv | buyerid    | integer                     |       4
public      | sales_lbv | eventid    | integer                     |       5
public      | sales_lbv | dateid     | smallint                    |       6
public      | sales_lbv | qtysold    | smallint                    |       7
public      | sales_lbv | pricepaid  | numeric(8,2)                |       8
public      | sales_lbv | commission | numeric(8,2)                |       9
public      | sales_lbv | saletime   | timestamp without time zone |      10
public      | event_lbv | eventid    | integer                     |       1
public      | event_lbv | venueid    | smallint                    |       2
public      | event_lbv | catid      | smallint                    |       3
public      | event_lbv | dateid     | smallint                    |       4
public      | event_lbv | eventname  | character varying(200)      |       5
public      | event_lbv | starttime  | timestamp without time zone |       6
```