怎么解決PostgreSQL日期格式導(dǎo)致的錯誤-創(chuàng)新互聯(lián)

這篇文章主要講解了“怎么解決PostgreSQL日期格式導(dǎo)致的錯誤”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么解決PostgreSQL日期格式導(dǎo)致的錯誤”吧!

成都創(chuàng)新互聯(lián)主要從事成都網(wǎng)站建設(shè)、做網(wǎng)站、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)長寧,10余年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):18982081108

由于日期格式的不同,PostgreSQL在執(zhí)行恢復(fù)讀取recovery.conf的時候會出現(xiàn)問題.
錯誤信息
在recovery.conf文件,recovery_target_time的設(shè)置

recovery_target_time='2019-3-11 14:40:00'

如按上述設(shè)置,則會出現(xiàn)錯誤

[xdb@localhost testdb]$ pg_ctl start
waiting for server to start....2019-03-11 14:04:45.121 CST [21749] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2019-03-11 14:04:45.121 CST [21749] LOG:  listening on IPv6 address "::", port 5432
2019-03-11 14:04:45.123 CST [21749] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2019-03-11 14:04:45.135 CST [21749] LOG:  redirecting log output to logging collector process
2019-03-11 14:04:45.135 CST [21749] HINT:  Future log output will appear in directory "log".
 stopped waiting
pg_ctl: could not start server
Examine the log output.

日志提示

[xdb@localhost log]$ cat postgresql-2019-03-11_122129.csv
2019-03-11 12:21:29.233 CST,,,1680,,5c85e249.690,1,,2019-03-11 12:21:29 CST,,0,LOG,00000,"ending log output to stderr",,"Futu
2019-03-11 12:21:29.236 CST,,,1682,,5c85e249.692,1,,2019-03-11 12:21:29 CST,,0,LOG,00000,"database system was interrupted; la
2019-03-11 12:21:29.249 CST,,,1682,,5c85e249.692,2,,2019-03-11 12:21:29 CST,,0,FATAL,42601,"syntax error in file ""recovery.c
2019-03-11 12:21:29.250 CST,,,1680,,5c85e249.690,2,,2019-03-11 12:21:29 CST,,0,LOG,00000,"startup process (PID 1682) exited w
2019-03-11 12:21:29.250 CST,,,1680,,5c85e249.690,3,,2019-03-11 12:21:29 CST,,0,LOG,00000,"aborting startup due to startup pro
2019-03-11 12:21:29.252 CST,,,1680,,5c85e249.690,4,,2019-03-11 12:21:29 CST,,0,LOG,00000,"database system is shut down",,,,,,

在recovery.conf文件的第3行有語法錯誤,猜測是日期格式問題

日期格式

testdb=# show datestyle;
 DateStyle 
-----------
 ISO, MDY
(1 row)

PG日期格式為月-日-年,recovery.conf文件的日期調(diào)整為該格式即可解決上述問題.

感謝各位的閱讀,以上就是“怎么解決PostgreSQL日期格式導(dǎo)致的錯誤”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對怎么解決PostgreSQL日期格式導(dǎo)致的錯誤這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

網(wǎng)站標(biāo)題:怎么解決PostgreSQL日期格式導(dǎo)致的錯誤-創(chuàng)新互聯(lián)
文章URL:http://muchs.cn/article0/pcdio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊、軟件開發(fā)、網(wǎng)站收錄小程序開發(fā)、用戶體驗App設(shè)計

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)