给表或字段添加注释

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# comment on table tbase is 'TDSQL PG分布式关系型数据库系统';
COMMENT
postgres=# \dt+
                                List of relations
 Schema |       Name        | Type  | Owner | Size  |         Description         
--------+-------------------+-------+-------+-------+-----------------------------
 public | t_appoint_col     | table | pgxz  | 16 kB | 
 public | t_first_col_share | table | pgxz  | 16 kB | 
 public | TBase             | table | pgxz  | 24 kB | TDSQLPG分布式关系型数据库系统
(3 rows)
postgres=# comment on column tbase.nickname is 'TDSQL PG呢称是大象';
COMMENT
postgres=# \d+ tbase
                                              Table "public.tbase"
  Column  |  Type   |                   Modifiers                    | Storage  | Stats target |   Description   
----------+---------+------------------------------------------------+----------+--------------+-----------------
 id       | integer | not null default nextval('t_id_seq'::regclass) | plain    |              | 
 nickname | text    |                                                | extended |              | TDSQL PG呢称是大象
Has OIDs: no
Distribute By SHARD(id)
        Location Nodes: ALL DATANODES

postgres=#