PGSQL查看建表语句
时间: 2023-09-04 17:14:27 浏览: 475
Mysql建表语句转化为postgre语句
回答: 要查看PGSQL中建表语句,可以使用以下SQL语句:
```sql
SELECT
pg_get_create_table('my_table'::regclass) AS create_table_statement
```
其中,将`my_table`替换为你要查看建表语句的表名。这条语句会返回该表的建表语句。请注意,该语句仅适用于具有相应权限的用户。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [常用SQL语句常见建表建索引等DDL语句(PGSQL)](https://blog.csdn.net/w8y56f/article/details/122967477)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文