您好,登錄后才能下訂單哦!
這篇文章主要介紹如何查看PostgreSQL里列注釋存放的位置,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
PostgreSQL里列注釋在哪兒
PostgreSQL里列注釋在pg_description表中。
pg_description存儲對每一個數(shù)據(jù)庫對象可選的描述(注釋)。描述可以通過COMMENT操作,并可使用psql的\d命令查看。在pg_description的初始內(nèi)容中提供了很多內(nèi)建系統(tǒng)對象的描述。
1、postgresql給列添加注釋信息
comment on column user.userid is 'The user ID';
2、postgresql給表添加注釋信息
comment on table user is 'Our session logs';
3、postgresql 查詢注釋信息
select description from pg_description join pg_class on pg_description.objoid = pg_class.oid where relname = 'user'
4、查詢指定schema下注釋信息:
select description from pg_description join pg_class on pg_description.objoid = pg_class.oid join pg_namespace on pg_class.relnamespace = pg_namespace.oid where relname = '<table name>' and nspname='<schema name>'
以上是如何查看PostgreSQL里列注釋存放的位置的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。