如何向表中添加描述

时间:2014-03-31 19:19:35

标签: sql postgresql

我知道\ d +列出了表格及其描述,例如:

                           List of relations
 Schema |      Name       | Type  |  Owner  |    Size    | Description
--------+-----------------+-------+---------+------------+-------------
 public | table1          | table | me      | 123 kB     |
 public | table2          | table | me      | 123 kB     |
 public | table3          | view  | me      | 123 kB     |
 public | table4          | table | me      | 123 kB     | some description
 public | table5          | table | me      | 123 kB     |
 public | table6          | table | me      | 123 kB     | another description
(6 rows)

我想知道如何改变描述或写一个描述(如果不存在)。

1 个答案:

答案 0 :(得分:0)

comment on table table1 is 'This is a new description';
comment on table table4 is 'This is a changed description';

手册中的更多详细信息:http://www.postgresql.org/docs/current/static/sql-comment.html

相关问题