vertica增加中文字段注释和中文表名注释

vertica增加中文字段注释

-- Note:Column comments are on the projection columns.
-- eg.
--   dbadmin=> comment on column public.test1.col1 is 'day';
--   ROLLBACK 2639:  Column "test1"."col1" does not exist as a projection column

-- step1:Get table's projection name
select min(projection_schema||'.'||projection_name) projection_name 
  from projections 
 where projection_schema = 'public' and anchor_table_name = 'test1'
;

-- step2:Comment on projection column 
comment on column public.test1_super.col1 is 'day';

-- check
select comment from comments where object_name = 'test1_super.col1';


-- Examples
dbadmin=> select min(projection_schema||'.'||projection_name) projection_name from projections where projection_schema = 'public' and anchor_table_name = 'test1';
dbadmin-> ;
  projection_name   
--------------------
 public.test1_super
(1 row)

dbadmin=> \d test1
                                                List of Fields by Tables
 Schema | Table | Column |    Type     | Size |             Default              | Not Null | Primary Key | Foreign Key 
--------+-------+--------+-------------+------+----------------------------------+----------+-------------+-------------
 public | test1 | col1   | varchar(8)  |    8 | to_char("sysdate"(), 'yyyymmdd') | f        | f           | 
 public | test1 | col2   | varchar(12) |   12 |                                  | f        | f           | 
 public | test1 | col3   | int         |    8 |                                  | f        | f           | 
(3 rows)

dbadmin=> select comment from comments where object_name = 'test1_super.col1';
 comment 
---------
(0 rows)

dbadmin=> comment on column public.test1.col1 is 'day';
ROLLBACK 2639:  Column "test1"."col1" does not exist as a projection column

dbadmin=> comment on column public.test1_super.col1 is 'day';
COMMENT
dbadmin=> select comment from comments where object_name = 'test1_super.col1';
 comment 
---------
 day
(1 row)

vertica增加中文字段

dbadmin=> comment on table public.test is '测试表';
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值