'2019/11/13'에 해당되는 글 1건

  1. 2019.11.13 postgres table schema comment 달기

pgadmin 프로그램 버전에서 테이블 클릭시 create table 명령과 함께 구조가 나오는데 거기에 주석을 다는 방법

웹 버전의 pgadmin(윈도우) 에서는 comment를 어떻게 볼수 있는지 모르겠네..

 

 

아무튼 결론

테이블을 만들고 나서 comment on column table.column_name is 'comment' 식으로 달면된다.

create table session_log 

   userid int not null, 
   phonenumber int
); 

comment on column session_log.userid is 'The user ID';
comment on column session_log.phonenumber is 'The phone number including the area code';

 

[링크 : http://lnk2580.blogspot.com/2014/12/db-postgresql-comment.html]

[링크 : https://stackoverflow.com/.../adding-comment-to-column-when-i-create-table-in-postgresql]

 

+

코멘트 없애는건 빈 코멘트를 쓰면된다.

Only one comment string is stored for each object, so to modify a comment, issue a new COMMENT command for the same object. To remove a comment, write NULL in place of the text string. Comments are automatically dropped when their object is dropped.

 

COMMENT ON COLUMN my_table.my_column IS 'Employee ID number';

[링크 : https://www.postgresql.org/docs/9.1/sql-comment.html]

[링크 : http://www.dbatodba.com/db2/db2-comment/]

 

+

테이블 컬럼의 코멘트는 웹 버전보다 리눅스 어플리케이션 버전이 더 보기 편하네?

[링크 : https://dataedo.com/kb/tools/pgadmin/how-to-view-and-edit-table-and-column-comments]

Posted by 구차니