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 '测试表';
还没有评论,来说两句吧...