{"id":16932,"date":"2024-05-10T11:01:25","date_gmt":"2024-05-10T03:01:25","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=16932"},"modified":"2026-05-29T09:46:21","modified_gmt":"2026-05-29T01:46:21","slug":"postgresql","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2024\/05\/10\/postgresql\/","title":{"rendered":"PostgreSQL\u90e8\u7f72\u4e0e\u4f7f\u7528"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">PostgreSQL\u662f\u4e00\u4e2a\u5f00\u6e90\u6570\u636e\u5e93\uff0c\u4ee5\u5176\u5f3a\u5927\u7684\u529f\u80fd\u3001\u6807\u51c6\u5408\u89c4\u6027\u3001\u53ef\u9760\u6027\u548c\u6269\u5c55\u6027\u53d7\u5230\u5e7f\u6cdb\u8ba4\u53ef\u548c\u91c7\u7528\u3002PostgreSQL\u9075\u5faaSQL\u6807\u51c6\uff0c\u652f\u6301NoSQL\u6570\u636e\u7c7b\u578b\uff08JSON\/XML\/hstore\uff09\u9012\u5f52\u67e5\u8be2\u3001\u5168\u6587\u641c\u7d22\u3001GIS\u5730\u7406\u4fe1\u606f\u5904\u7406\u7b49\uff0c\u80fd\u591f\u5e94\u5bf9\u5404\u79cd\u590d\u6742\u6570\u636e\u5206\u6790\u9700\u6c42\u3002\u5e7f\u6cdb\u5e94\u7528\u4e8e\u4e92\u8054\u7f51\u7f51\u7ad9\u3001\u4f01\u4e1a\u7ea7\u5e94\u7528\u540e\u7aef\u3001\u6570\u636e\u4ed3\u5e93\u4e0e\u5206\u6790\u5e73\u53f0\u3001\u4f4d\u7f6e\u5e94\u7528\u7cfb\u7edf\u3001\u590d\u6742\u6570\u636e\u5bf9\u8c61\u5904\u7406\u7b49\u5e94\u7528\u573a\u666f<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u901a\u8fc7\u5305\u7ba1\u7406\u5668<\/mark><\/strong><mark style=\"background-color: rgba(0, 0, 0, 0);\" class=\"has-inline-color has-vivid-purple-color\"><b>\u90e8\u7f72<\/b><\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u4f8b\u5b50\u4f7f\u7528ubuntu\u5b89\u88c5\uff0c\u53c2\u8003\u5b98\u7f51\u6559\u7a0b\uff1a<a href=\"https:\/\/www.postgresql.org\/download\/linux\/ubuntu\/\" data-type=\"link\" data-id=\"https:\/\/www.postgresql.org\/download\/linux\/ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">ubuntu\u5b89\u88c5postgresql<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install postgresql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u67e5\u770b\u670d\u52a1\u60c5\u51b5\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"394\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/5-1.jpg\" alt=\"\" class=\"wp-image-16939\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/5-1.jpg 693w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/5-1-300x171.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/5-1-600x341.jpg 600w\" sizes=\"auto, (max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u4e0a\u56fe\u770b\u51faPostgreSQL\u670d\u52a1\u7684\u72b6\u6001\u663e\u793a\u4e3a<code>Active: active (exited)<\/code>\u53ef\u80fd\u610f\u5473\u7740\u670d\u52a1\u5df2\u7ecf\u542f\u52a8\u5e76\u6210\u529f\u6267\u884c\u4e86\u5176\u4e3b\u8981\u529f\u80fd\uff0c\u4f46\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u6301\u7eed\u8fd0\u884c\u7684\u8fdb\u7a0b\u3002\u8fd9\u901a\u5e38\u51fa\u73b0\u5728\u201c\u4f1e\u5f0f\u201d\u670d\u52a1\uff08\u5982PostgreSQL\uff09\u4e2d\uff0c\u4f1e\u5f0f\u670d\u52a1\u4f1a\u542f\u52a8\u4e00\u4e2a\u6216\u591a\u4e2a\u5b50\u8fdb\u7a0b\u6765\u6267\u884c\u5b9e\u9645\u7684\u5de5\u4f5c\uff0c\u800c\u4e3b\u8fdb\u7a0b\uff08\u5373systemd\u8ba4\u4e3a\u7684\u201c\u670d\u52a1\u201d\uff09\u5728\u542f\u52a8\u5b50\u8fdb\u7a0b\u540e\u5c31\u4f1a\u9000\u51fa\u3002\u56e0\u6b64\uff0c\u5c3d\u7ba1\u4e3b\u8fdb\u7a0b\u5df2\u7ecf\u9000\u51fa\uff0c\u4f46\u5b50\u8fdb\u7a0b\u4ecd\u5728\u8fd0\u884c\uff0c\u63d0\u4f9b\u6570\u636e\u5e93\u670d\u52a1\uff0cpostgresql\u5c31\u662f\u4e00\u4e2a\u4f1e\u5f0f\u670d\u52a1\uff0c\u56e0\u6b64postgresql\u4e3b\u670d\u52a1\u542f\u52a8postgresql@14-main.service\u540e\u9000\u51fa\uff0c\u7531\u5b50\u8fdb\u7a0b\u63d0\u4f9b\u670d\u52a1<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u547d\u4ee4ps -ef |grep postgresql\u5373\u53ef\u67e5\u770b\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u4f4d\u7f6e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"64\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/6-1.jpg\" alt=\"\" class=\"wp-image-16941\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/6-1.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/6-1-300x28.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/6-1-600x56.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">postgresql\u9ed8\u8ba4\u76d1\u542c\u5730\u5740\u4e3a127.0.0.1\uff0c\u5982\u679c\u8981\u4fee\u6539\u76d1\u542c\u6240\u6709\u5730\u5740\uff0c\u53ef\u4fee\u6539listen_addresses\u5373\u53ef\uff0c\u7f16\u8f91postgresql.conf\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"204\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/7-1.jpg\" alt=\"\" class=\"wp-image-16943\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/7-1.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/7-1-300x89.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/7-1-600x177.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"132\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/8-1.jpg\" alt=\"\" class=\"wp-image-16945\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/8-1.jpg 692w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/8-1-300x57.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/8-1-600x114.jpg 600w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u4fee\u6539\u7aef\u53e3\u4e5f\u662f\u4fee\u6539\u6b64\u914d\u7f6e\u6587\u4ef6\u4e2d\u76845432\u7aef\u53e3\u4e3a\u5176\u4ed6\u7aef\u53e3\u5373\u53ef<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u7f6e\u5141\u8bb8\u901a\u8fc7\u5ba2\u6237\u7aef\u8fdc\u7a0b\u8fde\u63a5\uff0c\u7f16\u8f91pg_hba.conf\u6587\u4ef6\uff0c\u65b0\u589e\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u6587\u4ef6\u4e2d\u81ea\u5e26\u7684\u5176\u4ed6\u7684host all all 127.0.0.1\u8fd9\u79cd\u53ef\u4ee5\u6ce8\u91ca\u6389\nhost     all            all             0.0.0.0\/0               md5\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"69\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-8.jpg\" alt=\"\" class=\"wp-image-17448\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-8.jpg 692w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-8-300x30.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-8-600x60.jpg 600w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u91cd\u542f\u5373\u53ef systemctl restart &#8216;postgresql*&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8981\u5378\u8f7d\uff0c\u53ef\u6267\u884c\u5982\u4e0b\u51e0\u6761\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt remove --purge postgresql* #--purge\u53ef\u4ee5\u5b8c\u5168\u79fb\u9664\u5305\u4ee5\u53ca\u914d\u7f6e\u6587\u4ef6\r\nrm -rf \/var\/log\/postgresql*\r\nrm -rf \/var\/lib\/postgresql*\r\napt autoremove                 #\u5220\u9664\u4e0epostgresql\u76f8\u5173\u4f9d\u8d56<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u4e8c\u8fdb\u5236\u5b89\u88c5<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6e90\u7801\u4e0b\u8f7d\u5730\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.postgresql.org\/ftp\/source\/\" target=\"_blank\">https:\/\/www.postgresql.org\/ftp\/source\/<\/a>\uff0c\u6e90\u7801\u9700\u8981\u7f16\u8bd1\u4e3a\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u7136\u540e\u624d\u53ef\u4ee5\u90e8\u7f72<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u5b89\u88c5\u4f9d\u8d56\u5305\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install readline-devel libicu-devel python36-devel python36<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u6267\u884c\u547d\u4ee4\u7f16\u8bd1postgresql\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/configure --prefix=\/usr\/local\/postgresql16.3 --with-perl --with-python\nmake &amp;&amp; make install<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u540e\uff0c\u5728\u76ee\u5f55postgresql16.3\u4e0b\u53ef\u4ee5\u770b\u5230\u7f16\u8bd1\u540e\u7684\u6587\u4ef6\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"196\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/8-5.jpg\" alt=\"\" class=\"wp-image-17485\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/8-5.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/8-5-300x85.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/8-5-600x170.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u521b\u5efa\u7528\u6237\u548c\u7528\u6237\u7ec4\uff0c\u7ed9\u5b89\u88c5\u76ee\u5f55\u8d4b\u6743\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>groupadd postgres\nuseradd -m -g postgres postgres\nchown postgres:postgres -R \/usr\/local\/postgresql16.3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u521b\u5efa\u6570\u636e\u76ee\u5f55\uff0c\u5e76\u8bbe\u7f6e\u5c5e\u4e3b\u4ee5\u53ca\u5c5e\u7ec4\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/data\/postgresql\/data\nchown -R postgres:postgres \/data\/postgresql\/data<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u521d\u59cb\u5316\u6570\u636e\u5e93\uff0c\u9996\u5148\u767b\u5f55postgres\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - postgres\n\/usr\/local\/postgresql16.3\/bin\/initdb -D \/data\/postgresql\/data -E UTF8 --locale=en_US.UTF-8\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"236\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/2-9.jpg\" alt=\"\" class=\"wp-image-17492\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/2-9.jpg 688w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/2-9-300x103.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/2-9-600x206.jpg 600w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u521d\u59cb\u5316\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u770b\u5230\u6570\u636e\u76ee\u5f55\u4e0b\u5185\u5bb9\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"377\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-10.jpg\" alt=\"\" class=\"wp-image-17493\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-10.jpg 691w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-10-300x164.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/1-10-600x327.jpg 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u914d\u7f6e\u76d1\u542c\u5730\u5740\u6216\u8005\u4fee\u6539\u7aef\u53e3\uff0c\u53c2\u8003\u5305\u7ba1\u7406\u5668\u90e8\u7f72\u4e2d\u7684\u4fee\u6539\u5373\u53ef\uff0c\u8fd9\u91cc\u4e0d\u518d\u91cd\u590d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u542f\u52a8postgresql\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/postgresql16.3\/bin\/pg_ctl -D \/data\/postgresql\/data -l \/data\/postgresql\/data\/postgresql.log start<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u542f\u52a8\u540e\u67e5\u770b\u8f93\u51fa\u7684\u65e5\u5fd7\u4fe1\u606fpostgresql.log\uff0c\u5185\u5bb9\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"191\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/3-6.jpg\" alt=\"\" class=\"wp-image-17495\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/3-6.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/3-6-300x83.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/07\/3-6-600x166.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u505c\u6b62\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/postgresql16.3\/bin\/pg_ctl -D \/data\/postgresql\/data -l \/data\/postgresql\/data\/postgresql.log stop<\/code><\/pre>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\u610f\uff1apg_ctl\u8981\u4f7f\u7528\u5168\u8def\u5f84\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u95ee\u9898<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">7\u3001\u7f16\u5199\u670d\u52a1\u542f\u52a8\u6587\u4ef6\uff0c\u901a\u8fc7systemctl\u6258\u7ba1\uff0c\u7f16\u8f91postgresql.service\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=PostgreSQL RDBMS\n\n&#91;Service]\nType=oneshot\nExecStart=\/usr\/local\/postgresql16.3\/bin\/pg_ctl -D \/data\/postgresql\/data -l \/data\/postgresql\/data\/postgresql.log start\nExecStop=\/usr\/local\/postgresql16.3\/bin\/pg_ctl -D \/data\/postgresql\/data -l \/data\/postgresql\/data\/postgresql.log stop\nRemainAfterExit=on\nUser=postgres\nGroup=postgres\n\n&#91;Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u5c06\u7f16\u8bd1\u540e\u7684\u6587\u4ef6(\/usr\/local\/postgresql16.3)\u76f4\u63a5\u590d\u5236\u5230\u65b0\u7684\u673a\u5668\u4e0a\u8fdb\u884c\u521d\u59cb\u5316\u53ef\u80fd\u4f1a\u63d0\u793a\u7f3a\u5c11\u5e93\uff0c\u9700\u8981\u6267\u884c\u547d\u4ee4\u5b89\u88c5\u5373\u53efyum install readline-devel libicu-devel<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u4f7f\u7528<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">postgresql\u5b89\u88c5\u540e\uff0c\u4f1a\u9ed8\u8ba4\u5728Linux\u4e3b\u673a\u521b\u5efa\u7528\u6237postgres\uff0c\u6b64\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u767b\u5f55postgresql\uff0c\u5e76\u4e14\u662f\u8d85\u7ea7\u7ba1\u7406\u5458\u7528\u6237<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\u5207\u6362\u5230postgres\uff0c\u7136\u540e\u6267\u884c\u547d\u4ee4psql\uff0c\u767b\u5f55postgresql\uff0c\u6700\u540e\u6267\u884c\u547d\u4ee4\u67e5\u770b\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"382\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/9-1.jpg\" alt=\"\" class=\"wp-image-16948\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/9-1.jpg 694w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/9-1-300x165.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/9-1-600x330.jpg 600w\" sizes=\"auto, (max-width: 694px) 100vw, 694px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u4e0a\u56fe\u770b\u51fa\uff0c\u9ed8\u8ba4\u5305\u542b\u4e09\u4e2a\u6570\u636e\u5e93postgres\u3001template0\u3001template1\uff0c\u6240\u6709\u8005\u90fd\u662fpostgres<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b\u5f53\u524d\u7528\u6237\u4fe1\u606f\uff0c\u53ef\u4ee5\u770b\u5230\u53ea\u6709\u4e00\u4e2apostgres\uff0c\u5e76\u4e14\u662f\u8d85\u7ea7\u7ba1\u7406\u5458\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"158\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/10-1.jpg\" alt=\"\" class=\"wp-image-16950\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/10-1.jpg 693w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/10-1-300x68.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/10-1-600x137.jpg 600w\" sizes=\"auto, (max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u7ed9\u7528\u6237postgres\u8bbe\u7f6e\u4e00\u4e2a\u5bc6\u7801\uff0c\u6309\u7167\u4e0a\u9762\u65b9\u6cd5\u767b\u5f55postgresql\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alter user postgres with password '\u5bc6\u7801';<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539pg_hba.conf\uff0c\u5c06postgres\u7528\u6237\u7684\u8ba4\u8bc1\u65b9\u5f0f\u4ecepeer\u6539\u4e3amd5\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"68\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/11-1.jpg\" alt=\"\" class=\"wp-image-16953\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/11-1.jpg 691w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/11-1-300x30.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/11-1-600x59.jpg 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8981\u521b\u5efa\u7684\u5176\u4ed6\u7528\u6237\u4e5f\u8981\u901a\u8fc7\u5bc6\u7801\u767b\u5f55\uff0c\u90a3\u4e48\u5c06postgres\u90a3\u884c\u6ce8\u91ca\u6389\uff0c\u7136\u540e\u5c06\u4e0b\u9762\u7684\u5168\u90e8\u90fd\u662fall\u7684\u90a3\u884c\u6700\u540e\u4fee\u6539\u4e3amd5\u5373\u53ef\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"161\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-2.jpg\" alt=\"\" class=\"wp-image-16964\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-2.jpg 691w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-2-300x70.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-2-600x140.jpg 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">md5\u548cpeer\u7684\u533a\u522b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>md5<\/code> \u9700\u8981\u4f7f\u7528\u5bc6\u7801\u8fdb\u884c\u8ba4\u8bc1\uff0c\u800c <code>peer<\/code> \u4e0d\u9700\u8981\u5bc6\u7801\uff0c\u5b83\u4f9d\u8d56\u4e8e\u672c\u5730\u7cfb\u7edf\u7684\u7528\u6237\u8ba4\u8bc1\uff0c\u4e5f\u5c31\u662f\u8bf4\u5728Linux\u672c\u5730\u521b\u5efa\u4e86\u4e00\u4e2a\u7528\u6237abc\uff0c\u7136\u540e\u5728postgresql\u4e2d\u4e5f\u540c\u6837\u521b\u5efa\u4e86\u4e00\u4e2aabc\uff0c\u90a3\u4e48\u5982\u679c\u914d\u7f6e\u4e86peer\u8ba4\u8bc1\uff0c\u6b64\u65f6\u901a\u8fc7abc\u767b\u5f55\u5c31\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u6b21\u901a\u8fc7postgres\u767b\u5f55postgresql\uff0c\u53ef\u4ee5\u770b\u5230\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u8ba4\u8bc1\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"193\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-2.jpg\" alt=\"\" class=\"wp-image-16956\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-2.jpg 693w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-2-300x84.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-2-600x167.jpg 600w\" sizes=\"auto, (max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u5982\u679c\u5fd8\u8bb0\u4e86postgres\u5bc6\u7801\uff0c\u53ef\u4fee\u6539pg_hba.conf\u6587\u4ef6\uff0c\u5c06md5\u6539\u4e3apeer\u6216\u8005trust\uff0c\u7136\u540e\u5373\u53ef\u65e0\u5bc6\u7801\u767b\u5f55<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\u548c\u4e00\u4e2a\u65b0\u6570\u636e\u5e93\uff0c\u5c06\u6570\u636e\u5e93\u6743\u9650\u8d4b\u4e88\u7528\u6237\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create user test_user with password '123456#';\ncreate database test_db owner test_user;\ngrant all privileges on database test_db to test_user;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"131\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-3.jpg\" alt=\"\" class=\"wp-image-16960\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-3.jpg 691w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-3-300x57.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-3-600x114.jpg 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"67\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-2.jpg\" alt=\"\" class=\"wp-image-16962\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-2.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-2-300x29.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-2-600x58.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u547d\u4ee4\u884c\u901a\u8fc7\u65b0\u521b\u5efa\u7684\u7528\u6237\u548c\u5bc6\u7801\u6765\u8fde\u63a5postgresql\u7684test_db\u5e93\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"346\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-2.jpg\" alt=\"\" class=\"wp-image-16966\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-2.jpg 690w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-2-300x150.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-2-600x301.jpg 600w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u767b\u5f55\u5c31\u5df2\u7ecf\u5728\u5e93test_db\u4e2d\u4e86\uff0c\u901a\u8fc7<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">create\u547d\u4ee4\u521b\u5efa\u8868<\/mark><\/strong>\uff0cid\u4e3a\u4e3b\u952e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"199\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-4.jpg\" alt=\"\" class=\"wp-image-16973\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-4.jpg 692w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-4-300x86.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-4-600x173.jpg 600w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>serial\uff1a\u8868\u793a\u81ea\u589e<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u6267\u884c\\d student\u547d\u4ee4\u5373\u53ef\u67e5\u770b\u8868\u7ed3\u6784\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"253\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-3.jpg\" alt=\"\" class=\"wp-image-16974\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-3.jpg 705w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-3-300x108.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-3-600x215.jpg 600w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u901a\u8fc7<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">drop \u547d\u4ee4\u5220\u9664\u8868<\/mark><\/strong>\uff0c\u53ef\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>drop table tablename<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u6267\u884cINSERT\u3001UPDATE\u3001DELETE\u8bed\u53e5\u6765\u4fee\u6539\u8868\uff0c\u9996\u5148\u6267\u884cINSERT\u63d2\u5165\u6570\u636e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>insert into student (number,student_name,age,math_score) values(101,'zhangsan',18,99);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"693\" height=\"190\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-5.jpg\" alt=\"\" class=\"wp-image-16976\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-5.jpg 693w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-5-300x82.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/1-5-600x165.jpg 600w\" sizes=\"auto, (max-width: 693px) 100vw, 693px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884cUPDATE\u547d\u4ee4\u4fee\u6539\u8868\u4e2d\u6570\u636e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"177\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-4.jpg\" alt=\"\" class=\"wp-image-16978\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-4.jpg 692w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-4-300x77.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/2-4-600x153.jpg 600w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884cDELETE\u5220\u9664\u8868\u4e2d\u6570\u636e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"165\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-3.jpg\" alt=\"\" class=\"wp-image-16980\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-3.jpg 691w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-3-300x72.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/3-3-600x143.jpg 600w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6ce8\uff1a\u56e0\u4e3aid\u4e3a\u81ea\u589e\u5e8f\u5217\uff0c\u5220\u9664\u540e\u9700\u8981\u91cd\u7f6e\u5e8f\u5217\uff0c\u5426\u5219\u518d\u6b21\u63d2\u5165\u6570\u636e\u5c06\u4eceid\u4e3a2\u5f00\u59cb\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u91cd\u7f6e:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER SEQUENCE student_id_seq RESTART WITH 1;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">student_id_seq\u662f\u54ea\u91cc\u6765\u7684\uff0c\u6267\u884c\\d\u547d\u4ee4\u5373\u53ef\u770b\u5230\uff0cstudent\u8868\u5bf9\u5e94\u7684\u5c31\u662fstudent_id_seq\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"696\" height=\"203\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-3.jpg\" alt=\"\" class=\"wp-image-16983\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-3.jpg 696w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-3-300x88.jpg 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2024\/05\/4-3-600x175.jpg 600w\" sizes=\"auto, (max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u4f7f\u7528\\h create table\u7b49\u65b9\u5f0f\u53ef\u4ee5\u67e5\u770bpostgresql\u4e2d\u5404\u79cd\u547d\u4ee4\u7528\u6cd5<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u5f00\u542fpg_trgm\u6269\u5c55<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pg_trgm\u4e0d\u662f<strong>\u63d0\u4f9b\u6a21\u7cca\u67e5\u8be2\u529f\u80fd<\/strong>\uff0c\u800c\u662f<strong>\u7ed9\u6a21\u7cca\u67e5\u8be2\u52a0\u901f<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u533a\u522b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u542f\u7528 pg_trgm\uff1a\u6a21\u7cca\u67e5\u8be2 = <strong>\u5168\u8868\u626b\u63cf<\/strong>\uff0c\u6570\u636e\u91cf\u5927 \u2192 <strong>\u5de8\u6162\u3001\u5361\u6b7b<\/strong><\/li>\n\n\n\n<li>\u542f\u7528pg_trgm\uff1a\u6a21\u7cca\u67e5\u8be2 = <strong>\u8d70\u7d22\u5f15<\/strong>\uff0c\u6570\u636e\u91cf\u5927 \u2192 <strong>\u98de\u5feb<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770bpg_trgm\u662f\u5426\u5f00\u542f\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM pg_extension WHERE extname = 'pg_trgm';<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"128\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/5.png\" alt=\"\" class=\"wp-image-20271\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/5.png 672w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/5-300x57.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/5-600x114.png 600w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u547d\u4ee4\u5f00\u542f\u540e\u518d\u6b21\u67e5\u8be2\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE EXTENSION IF NOT EXISTS pg_trgm;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"176\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/6.png\" alt=\"\" class=\"wp-image-20272\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/6.png 652w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/6-300x81.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2026\/05\/6-600x162.png 600w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1apg_trgm\u662f\u9488\u5bf9\u5355\u72ec\u5e93\u7684\uff0c\u4e0d\u662f\u9488\u5bf9\u6574\u4e2aPgSQL\uff0cpg_trgm\u5f00\u542f\u4e00\u6b21\u6c38\u4e45\u6709\u6548<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL\u662f\u4e00\u4e2a\u5f00\u6e90\u6570\u636e\u5e93\uff0c\u4ee5\u5176\u5f3a\u5927\u7684\u529f\u80fd\u3001\u6807\u51c6\u5408\u89c4\u6027\u3001\u53ef\u9760\u6027\u548c\u6269\u5c55\u6027\u53d7\u5230\u5e7f\u6cdb\u8ba4\u53ef\u548c\u91c7\u7528\u3002Postg [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":16933,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157,25],"tags":[],"class_list":["post-16932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","category-database"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/16932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=16932"}],"version-history":[{"count":58,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/16932\/revisions"}],"predecessor-version":[{"id":20469,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/16932\/revisions\/20469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/16933"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=16932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=16932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=16932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}