

 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/)。

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

# 使用 SHOW 命令
<a name="discovering-metadata-show-commands"></a>

如果驅動程式中繼資料 API 未涵蓋您的使用案例，您可以使用 Amazon Redshift `SHOW`命令來擷取中繼資料。 `SHOW`命令已針對快速中繼資料擷取進行最佳化。當您在互動式 SQL 工作階段中需要中繼資料，或您的應用程式透過不會公開驅動程式中繼資料 API 的用戶端連線時，它們很有用。

常見探索操作支援下列`SHOW`命令：
+ [顯示資料庫](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_DATABASES.html)
+ [顯示結構描述](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_SCHEMAS.html)
+ [顯示資料表](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_TABLES.html)
+ [顯示資料欄](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_COLUMNS.html)
+ [顯示限制條件](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_CONSTRAINTS.html)
+ [顯示授予](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_GRANTS.html)
+ [顯示 函數](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_FUNCTIONS.html)
+ [顯示程序](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_PROCEDURES.html)
+ [顯示參數](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW_PARAMETERS.html)

## 範例
<a name="r_SHOW_LIST-examples"></a>

```
SHOW SCHEMAS FROM DATABASE dev;

database_name |     schema_name      | schema_owner | schema_type |         schema_acl          | source_database | schema_option 
---------------+----------------------+--------------+-------------+-----------------------------+-----------------+---------------
dev           | pg_automv            |            1 | local       |                             |                 | 
dev           | pg_catalog           |            1 | local       | jpuser=UC/jpuser~=U/jpuser  |                 | 
dev           | public               |            1 | local       | jpuser=UC/jpuser~=UC/jpuser |                 | 
dev           | information_schema   |            1 | local       | jpuser=UC/jpuser~=U/jpuser  |                 | 
dev           | schemad79cd6d93bf043 |            1 | local       |                             |                 |
```

```
SHOW TABLES FROM SCHEMA dev.s1 LIKE '%view' LIMIT 1;

database_name | schema_name |    table_name     | table_type |              table_acl               | remarks | owner | last_altered_time | last_modified_time | dist_style |   table_subtype   
---------------+-------------+-------------------+------------+--------------------------------------+---------+-------+-------------------+--------------------+------------+-------------------
dev           | s1          | late_binding_view | VIEW       | {alice=arwdRxtDPA/alice,bob=d/alice} |         | alice |                   |                    |            | LATE BINDING VIEW
```

```
SHOW COLUMNS FROM TABLE second_db.public.t22;

 database_name | schema_name | table_name | column_name | ordinal_position | column_default | is_nullable |          data_type          | character_maximum_length | numeric_precision | numeric_scale | remarks | sort_key_type | sort_key | dist_key | encoding | collation 
---------------+-------------+------------+-------------+------------------+----------------+-------------+-----------------------------+--------------------------+-------------------+---------------+---------+---------------+----------+----------+----------+-----------
 second_db     | public      | t22        | col1        |                1 |                | YES         | integer                     |                          |                32 |             0 |         | INTERLEAVED   |       -1 |          | mostly8  | 
 second_db     | public      | t22        | col2        |                2 |                | YES         | character varying           |                      100 |                   |               |         | INTERLEAVED   |        2 |          | text255  | default
 second_db     | public      | t22        | col3        |                3 |                | YES         | timestamp without time zone |                          |                   |               |         |               |        0 |          | raw      | 
 second_db     | public      | t22        | col4        |                4 |                | YES         | numeric                     |                          |                10 |             2 |         |               |        0 |          | az64     |
```

如需詳細資訊，請參閱《Amazon Redshift 資料庫開發人員指南》**中的 [SHOW](https://docs.aws.amazon.com/redshift/latest/dg/r_SHOW.html)。