{"id":6967,"date":"2020-04-25T19:55:11","date_gmt":"2020-04-25T11:55:11","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=6967"},"modified":"2020-04-29T08:12:31","modified_gmt":"2020-04-29T00:12:31","slug":"psql","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/psql","title":{"rendered":"psql\u547d\u4ee4 – PostgreSQL\u4ea4\u4e92\u5f0f\u5ba2\u6237\u7aef\u5de5\u5177"},"content":{"rendered":"\n

psql\u662fPostgreSQL\u7684\u4ea4\u4e92\u5f0f\u5ba2\u6237\u7aef\u5de5\u5177\uff0c\u901a\u8fc7\u8be5\u5de5\u5177\u6765\u7ba1\u7406\u548c\u64cd\u4f5cPostgreSQL\u6570\u636e\u5e93\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>psql [\u53c2\u6570] [\u6570\u636e\u5e93\u540d\u79f0[\u7528\u6237\u540d\u79f0]]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-h<\/td>\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e3b\u673a<\/td><\/tr>
-p<\/td>\u6307\u5b9aPostgreSQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u7aef\u53e3\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u5219\u9ed8\u8ba4\u662f5432<\/td><\/tr>
-w<\/td>\u6c38\u8fdc\u4e0d\u63d0\u793a\u8f93\u5165\u53e3\u4ee4<\/td><\/tr>
-e<\/td>\u663e\u793a\u53d1\u9001\u7ed9\u670d\u52a1\u5668\u7684\u547d\u4ee4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u8fde\u63a5\u5230\u6570\u636e\u5e93template1\uff0c\u5e76\u5217\u51fa\u670d\u52a1\u5668\u4e0a\u6240\u6709\u7684\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# psql template1<\/pre>\n\n\n\n

\u8fdb\u5165\u6570\u636e\u5e93postgres\uff1a<\/p>\n\n\n\n

psql -U postgres<\/pre>\n\n\n\n

\u8fdb\u5165\u6570\u636e\u5e93\u67e5\u770b\uff1a<\/p>\n\n\n\n

psql -U postgres \n\\l<\/pre>\n","protected":false},"excerpt":{"rendered":"

psql\u662fPostgreSQL\u7684\u4ea4\u4e92\u5f0f\u5ba2\u6237\u7aef\u5de5\u5177\uff0c\u901a\u8fc7\u8be5\u5de5\u5177\u6765\u7ba1\u7406\u548c\u64cd\u4f5cPostgreSQL\u6570\u636e\u5e93\u3002 \u8bed\u6cd5\u683c\u5f0f […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6967"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=6967"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6967\/revisions"}],"predecessor-version":[{"id":7121,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/6967\/revisions\/7121"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=6967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=6967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=6967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}