1、查看當(dāng)前數(shù)據(jù)庫版本
創(chuàng)新互聯(lián)主要從事成都做網(wǎng)站、成都網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)海鹽,十年網(wǎng)站建設(shè)經(jīng)驗(yàn),價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):18982081108
mydb=#?select?version(); ?????????????????????????????????????????????????version????????????????????????????????????????????????? --------------------------------------------------------------------------------------------------------- ?PostgreSQL?12.0?on?x86_64-pc-linux-gnu,?compiled?by?gcc?(GCC)?4.8.5?20150623?(Red?Hat?4.8.5-39),?64-bit
2、with子句,查看role和組的關(guān)系
with temp as?
(select? a.rolname,a.rolsuper,m.member from? pg_authid a join pg_auth_members m?
on a.oid=m.roleid)
select temp.rolname,temp.rolsuper,s.rolname as groupname from temp join pg_authid s?
on temp.member = s.oid;
mydb=#?with?temp?as? mydb-#?(select??a.rolname,a.rolsuper,m.member?from??pg_authid?a?join?pg_auth_members?m? mydb(#?on?a.oid=m.roleid) mydb-#?select?temp.rolname,temp.rolsuper,s.rolname?as?groupname?from?temp?join?pg_authid?s? mydb-#?on?temp.member?=?s.oid; ???????rolname????????|?rolsuper?|?groupname?? ----------------------+----------+------------ ?pg_read_all_settings?|?f????????|?pg_monitor ?pg_read_all_stats????|?f????????|?pg_monitor ?pg_stat_scan_tables??|?f????????|?pg_monitor
文章名稱:postgresqlwith子句
鏈接URL:http://www.rwnh.cn/article4/gdihie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)、微信小程序、網(wǎng)站導(dǎo)航、標(biāo)簽優(yōu)化、面包屑導(dǎo)航、定制開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)