今天就跟大家聊聊有關(guān)怎么查看PostgreSQL的版本信息,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
psql --version
2.1 查看詳細(xì)信息
select version();
2.2 查看版本信息
show server_version;
2.2 查看數(shù)字版本信息包括小版號(hào)
SHOW server_version_num;
或
SELECT current_setting('server_version_num');
SELECT current_setting(‘server_version_num');返回類(lèi)型為text,如果需要可以轉(zhuǎn)換為interger SELECT current_setting('server_version_num')::integer;
補(bǔ)充:postgresql服務(wù)器版本和psql版本不一致解決辦法
$ psql -U peimsmdata -h 127.0.0.1 peimsm could not change directory to "/root" Password for user peimsmdata: psql (9.2.23, server 9.6.3) WARNING: psql version 9.2, server version 9.6. Some psql features might not work. Type "help" for help.
雖然系統(tǒng)安裝了9.6版本的pgsql,但是psql這個(gè)腳本卻引用了舊的版本。
替換系統(tǒng)中舊版本的psql腳本為新的版本。
$ psql --version could not change directory to "/root" psql (PostgreSQL) 9.2.23 # which -a psql /usr/bin/psql /usr/local/postgresql/bin/psql /bin/psql # mv /usr/bin/psql /usr/bin/psql.bak # ln -s /usr/local/postgresql/bin/psql /usr/bin/psql $ psql -U peimsmdata -h 127.0.0.1 peimsm could not change directory to "/root": Permission denied Password for user peimsmdata: psql (9.6.3) Type "help" for help.
看完上述內(nèi)容,你們對(duì)怎么查看PostgreSQL的版本信息有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。
分享題目:怎么查看PostgreSQL的版本信息-創(chuàng)新互聯(lián)
URL標(biāo)題:http://m.newbst.com/article30/cegiso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、關(guān)鍵詞優(yōu)化、做網(wǎng)站、App開(kāi)發(fā)、商城網(wǎng)站、自適應(yīng)網(wǎng)站
聲明:本網(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)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容