1、查看當(dāng)前數(shù)據(jù)庫(kù)版本
創(chuàng)新互聯(lián)主要從事成都做網(wǎng)站、成都網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)海鹽,十年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(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
文章名稱(chēng):postgresqlwith子句
鏈接URL:http://aaarwkj.com/article4/gdihie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營(yíng)銷(xiāo)型網(wǎng)站建設(shè)、微信小程序、網(wǎng)站導(dǎo)航、標(biāo)簽優(yōu)化、面包屑導(dǎo)航、定制開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)