溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

如何查看PostgreSQL里列注釋存放的位置

發(fā)布時間:2020-07-16 14:40:30 來源:億速云 閱讀:656 作者:清晨 欄目:編程語言

這篇文章主要介紹如何查看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';

如何查看PostgreSQL里列注釋存放的位置

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è)資訊頻道!

向AI問一下細節(jié)

免責聲明:本站發(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)容。

AI