{"id":50738,"date":"2023-12-23T10:31:40","date_gmt":"2023-12-23T02:31:40","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/"},"modified":"2023-12-23T15:27:38","modified_gmt":"2023-12-23T07:27:38","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/","title":{"rendered":"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL"},"content":{"rendered":"<h3>\u5f15\u8a00<\/h3>\n<p>\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u8bb8\u591a\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u5e8f\u7684\u5b58\u50a8\u3001\u7ec4\u7ec7\u548c\u8bbf\u95ee\u4fe1\u606f\u7684\u65b9\u5f0f\u3002<\/p>\n<p>PostgreSQL\uff0c\u53c8\u88ab\u79f0\u4e3aPostgres\uff0c\u662f\u4e00\u4e2a\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u7ed3\u6784\u5316\u67e5\u8be2\u8bed\u8a00\uff08Structured Query Language\uff09\u7684\u5b9e\u73b0\u3002\u5b83\u88ab\u8bb8\u591a\u6d41\u884c\u7684\u9879\u76ee\uff0c\u65e0\u8bba\u5927\u5c0f\uff0c\u5e7f\u6cdb\u4f7f\u7528\uff0c\u7b26\u5408\u6807\u51c6\uff0c\u5e76\u5177\u6709\u53ef\u9760\u7684\u4e8b\u52a1\u548c\u65e0\u8bfb\u53d6\u9501\u7684\u5e76\u53d1\u7b49\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\u3002<\/p>\n<p>\u901a\u8fc7\u9075\u5faa\u8fd9\u4e2a\u6307\u5357\uff0c\u60a8\u5c06\u5728Rocky Linux 9\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684PostgreSQL\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u4e3a\u4e86\u5b8c\u6210\u8fd9\u4e2a\u6559\u7a0b\uff0c\u4f60\u9700\u8981\u4e00\u4e2a\u8fd0\u884cRocky Linux 9\u7684\u670d\u52a1\u5668\u3002\u8be5\u670d\u52a1\u5668\u5e94\u8be5\u6709\u4e00\u4e2a\u5177\u6709\u7ba1\u7406\u6743\u9650\u7684\u975eroot\u7528\u6237\uff0c\u5e76\u4e14\u914d\u7f6e\u4e86firewalld\u9632\u706b\u5899\u3002\u8981\u8fdb\u884c\u8bbe\u7f6e\uff0c\u8bf7\u53c2\u8003\u6211\u4eec\u7684Rocky Linux 9\u521d\u6b65\u670d\u52a1\u5668\u8bbe\u7f6e\u6307\u5357\u3002<\/p>\n<h2>\u6b65\u9aa4\u4e00 \u2014 \u5b89\u88c5 PostgreSQL<\/h2>\n<p>PostgreSQL\u53ef\u4ee5\u4eceRocky Linux\u7684\u9ed8\u8ba4\u8f6f\u4ef6\u5e93\u4e2d\u83b7\u53d6\uff0c\u5e76\u53ef\u4ee5\u4f7f\u7528Rocky\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668dnf\u8fdb\u884c\u5b89\u88c5\u3002\u540c\u65f6\uff0c\u60a8\u8fd8\u5e94\u8be5\u5b89\u88c5\u53e6\u4e00\u4e2a\u540d\u4e3aglibc-all-langpacks\u7684\u8f6f\u4ef6\u5305\uff0c\u4ee5\u63d0\u9ad8Postgres\u7684\u591a\u8bed\u8a00\u652f\u6301\u3002\u53ef\u4ee5\u901a\u8fc7dnf install\u547d\u4ee4\u540c\u65f6\u5b89\u88c5\u5b83\u4eec\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> dnf <span class=\"token function\">install<\/span> postgresql-server glibc-all-langpacks\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5f53\u6536\u5230\u63d0\u793a\u65f6\uff0c\u8bf7\u6309y\u7136\u540e\u6309\u56de\u8f66\u952e\u786e\u8ba4\u5b89\u88c5\u3002<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cRocky Linux 9\u5b89\u88c5\u7684\u662fPostgreSQL 13\u7248\u672c\u3002\u73b0\u5728\u8f6f\u4ef6\u5df2\u5b89\u88c5\u5b8c\u6210\uff0c\u60a8\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u521d\u59cb\u5316\u6b65\u9aa4\uff0c\u4ee5\u51c6\u5907\u4e00\u4e2a\u65b0\u7684PostgreSQL\u6570\u636e\u5e93\u96c6\u7fa4\u3002<\/p>\n<h2>\u6b65\u9aa42 \u2014 \u521b\u5efa\u4e00\u4e2a\u65b0\u7684PostgreSQL\u6570\u636e\u5e93\u96c6\u7fa4<\/h2>\n<p>\u5728\u5f00\u59cb\u521b\u5efa\u8868\u5e76\u52a0\u8f7d\u6570\u636e\u4e4b\u524d\uff0c\u60a8\u5fc5\u987b\u5148\u521b\u5efa\u4e00\u4e2a\u65b0\u7684PostgreSQL\u6570\u636e\u5e93\u96c6\u7fa4\u3002\u6570\u636e\u5e93\u96c6\u7fa4\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u6570\u636e\u5e93\u96c6\u5408\u3002\u521b\u5efa\u6570\u636e\u5e93\u96c6\u7fa4\u5305\u62ec\u521b\u5efa\u5c06\u653e\u7f6e\u6570\u636e\u5e93\u6570\u636e\u7684\u76ee\u5f55\u3001\u751f\u6210\u5171\u4eab\u76ee\u5f55\u8868\u4ee5\u53ca\u521b\u5efatemplate1\u548cpostgres\u6570\u636e\u5e93\u3002<\/p>\n<p>template1\u6570\u636e\u5e93\u662f\u4e00\u79cd\u6a21\u677f\uff0c\u7528\u4e8e\u521b\u5efa\u65b0\u7684\u6570\u636e\u5e93\uff1btemplate1\u4e2d\u5b58\u50a8\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5305\u62ec\u81ea\u5df1\u6dfb\u52a0\u7684\u5bf9\u8c61\uff0c\u5c06\u5728\u521b\u5efa\u65f6\u88ab\u653e\u7f6e\u5728\u65b0\u7684\u6570\u636e\u5e93\u4e2d\u3002postgres\u6570\u636e\u5e93\u662f\u4e00\u4e2a\u9ed8\u8ba4\u6570\u636e\u5e93\uff0c\u4e13\u4e3a\u7528\u6237\u3001\u5b9e\u7528\u5de5\u5177\u548c\u7b2c\u4e09\u65b9\u5e94\u7528\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u3002<\/p>\n<p>\u5728\u524d\u4e00\u6b65\u9aa4\u4e2d\u5b89\u88c5\u7684Postgres\u8f6f\u4ef6\u5305\u9644\u5e26\u4e86\u4e00\u4e2a\u65b9\u4fbf\u7684\u811a\u672c\uff0c\u540d\u4e3apostgresql-setup\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u8fdb\u884c\u4f4e\u7ea7\u522b\u7684\u6570\u636e\u5e93\u96c6\u7fa4\u7ba1\u7406\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u8bf7\u4f7f\u7528sudo\u548c&#8211;initdb\u9009\u9879\u8fd0\u884c\u8be5\u811a\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> postgresql-setup <span class=\"token parameter variable\">--initdb<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u60a8\u5c06\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div> * Initializing database in '\/var\/lib\/pgsql\/data'\r\n * Initialized, logs are in \/var\/lib\/pgsql\/initdb_postgresql.log\r\n<\/code><\/pre>\n<p>\u73b0\u5728\u4f7f\u7528systemctl\u542f\u52a8PostgreSQL\u670d\u52a1\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl start postgresql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u7136\u540e\uff0c\u518d\u6b21\u4f7f\u7528systemctl\u547d\u4ee4\uff0c\u4f7f\u5f97\u670d\u52a1\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> postgresql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u4ea7\u751f\u4ee5\u4e0b\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div>Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/postgresql.service \u2192 \/usr\/lib\/systemd\/system\/postgresql.service.\r\n<\/code><\/pre>\n<p>\u65e2\u7136PostgreSQL\u5df2\u7ecf\u542f\u52a8\u8fd0\u884c\u4e86\uff0c\u6211\u4eec\u5c06\u901a\u8fc7\u4f7f\u7528\u89d2\u8272\u6765\u4e86\u89e3Postgres\u7684\u5de5\u4f5c\u539f\u7406\u4ee5\u53ca\u5b83\u4e0e\u60a8\u8fc7\u53bb\u53ef\u80fd\u4f7f\u7528\u8fc7\u7684\u7c7b\u4f3c\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u533a\u522b\u3002<\/p>\n<h2>\u7b2c\u4e09\u6b65 &#8211; \u4f7f\u7528PostgreSQL\u89d2\u8272\u548c\u6570\u636e\u5e93<\/h2>\n<p>PostgreSQL\u4f7f\u7528\u4e00\u79cd\u79f0\u4e3a\u89d2\u8272\u7684\u6982\u5ff5\u6765\u5904\u7406\u5ba2\u6237\u7aef\u8eab\u4efd\u9a8c\u8bc1\u548c\u6388\u6743\u3002\u5728\u67d0\u4e9b\u65b9\u9762\uff0c\u8fd9\u4e0e\u5e38\u89c4\u7684\u7c7bUnix\u8d26\u6237\u7c7b\u4f3c\uff0c\u4f46\u662fPostgres\u4e0d\u533a\u5206\u7528\u6237\u548c\u7ec4\uff0c\u800c\u66f4\u503e\u5411\u4e8e\u66f4\u52a0\u7075\u6d3b\u7684\u672f\u8bed\u89d2\u8272\u3002<\/p>\n<p>\u5b89\u88c5\u540e\uff0cPostgres\u88ab\u8bbe\u7f6e\u4e3a\u4f7f\u7528\u6807\u8bc6\u8ba4\u8bc1\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u5c06Postgres\u89d2\u8272\u4e0e\u76f8\u5339\u914d\u7684Unix\/Linux\u7cfb\u7edf\u5e10\u6237\u5173\u8054\u8d77\u6765\u3002\u5982\u679c\u5728Postgres\u4e2d\u5b58\u5728\u4e00\u4e2a\u89d2\u8272\uff0c\u5177\u6709\u76f8\u540c\u540d\u79f0\u7684Unix\/Linux\u7528\u6237\u540d\u53ef\u4ee5\u4f5c\u4e3a\u8be5\u89d2\u8272\u767b\u5f55\u3002<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4f1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3apostgres\u7684\u7528\u6237\u5e10\u6237\uff0c\u8be5\u5e10\u6237\u4e0e\u9ed8\u8ba4\u7684postgres\u89d2\u8272\u76f8\u5173\u8054\u3002\u8981\u4f7f\u7528PostgreSQL\uff0c\u60a8\u53ef\u4ee5\u767b\u5f55\u5230\u8be5\u5e10\u6237\u3002<\/p>\n<p>\u8fd9\u4e2a\u5e10\u6237\u6709\u51e0\u79cd\u4f7f\u7528\u65b9\u5f0f\u6765\u8bbf\u95eePostgreSQL\u63d0\u793a\u7b26\u3002<\/p>\n<h3>\u5207\u6362\u5230postgres\u5e10\u6237<\/h3>\n<p>\u901a\u8fc7\u952e\u5165\u5207\u6362\u5230\u60a8\u670d\u52a1\u5668\u4e0a\u7684postgres\u5e10\u6237\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token parameter variable\">-u<\/span> postgres\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u73b0\u5728\u60a8\u53ef\u4ee5\u7acb\u5373\u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u8bbf\u95eePostgres\u63d0\u793a\u7b26\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"[postgres@server ~$]\">psql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u767b\u5f55\u5230PostgreSQL\u63d0\u793a\u7b26\uff0c\u5e76\u4ece\u8fd9\u91cc\u5f00\u59cb\uff0c\u60a8\u53ef\u4ee5\u7acb\u5373\u4e0e\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u901a\u8fc7\u952e\u5165\u7684\u65b9\u5f0f\u9000\u51faPostgreSQL\u63d0\u793a\u7b26\uff1a\u9000\u51fa\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>q\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u8ba9\u4f60\u56de\u5230postgres\u8d26\u6237\u7684Linux\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u73b0\u5728\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u8fd4\u56de\u5230\u4f60\u7684\u539f\u59cb\u8d26\u6237\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"[postgres@server ~$]\"><span class=\"token builtin class-name\">exit<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<h3>\u901a\u8fc7\u4e0d\u5207\u6362\u8d26\u6237\u8bbf\u95eePostgres\u63d0\u793a\u7b26<\/h3>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528sudo\u8fd0\u884cpostgres\u8d26\u6237\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5728\u524d\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u60a8\u88ab\u6307\u793a\u9996\u5148\u5207\u6362\u5230postgres\u7528\u6237\uff0c\u7136\u540e\u8fd0\u884cpsql\u6253\u5f00Postgres\u63d0\u793a\u7b26\u3002\u4f5c\u4e3a\u66ff\u4ee3\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528sudo\u4f5c\u4e3apostgres\u7528\u6237\u8fd0\u884c\u5355\u4e2a\u547d\u4ee4psql\u6765\u4e00\u6b21\u6027\u5b8c\u6210\uff0c\u5c31\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-u<\/span> postgres psql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u76f4\u63a5\u5c06\u60a8\u767b\u5f55\u5230Postgres\uff0c\u65e0\u9700\u901a\u8fc7\u4e2d\u95f4\u7684bash shell\u3002<\/p>\n<p>\u540c\u6837\u5730\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u952e\u5165\u547d\u4ee4\u6765\u9000\u51fa\u4e92\u52a8\u5f0fPostgres\u4f1a\u8bdd\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"postgres=#\"><span class=\"token punctuation\">\\<\/span>q\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u6b65\u9aa4\u4e2d\uff0c\u60a8\u4f7f\u7528postgres\u8d26\u6237\u6765\u8fdb\u5165psql\u63d0\u793a\u7b26\u3002\u4f46\u662f\u8bb8\u591a\u4f7f\u7528\u60c5\u51b5\u9700\u8981\u591a\u4e2aPostgres\u89d2\u8272\u3002\u8bf7\u7ee7\u7eed\u9605\u8bfb\u4ee5\u4e86\u89e3\u5982\u4f55\u914d\u7f6e\u65b0\u89d2\u8272\u3002<\/p>\n<h2>\u7b2c\u56db\u6b65 \u2014 \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u89d2\u8272<\/h2>\n<p>\u76ee\u524d\uff0c\u6570\u636e\u5e93\u4e2d\u53ea\u914d\u7f6e\u4e86postgres\u89d2\u8272\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528createrole\u547d\u4ee4\u5728\u547d\u4ee4\u884c\u4e0a\u521b\u5efa\u65b0\u89d2\u8272\u3002&#8211;interactive\u6807\u5fd7\u5c06\u63d0\u793a\u60a8\u8f93\u5165\u65b0\u89d2\u8272\u7684\u540d\u79f0\uff0c\u5e76\u8be2\u95ee\u662f\u5426\u5e94\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002<\/p>\n<p>\u5982\u679c\u60a8\u4ee5postgres\u8d26\u6237\u767b\u5f55\uff0c\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u521b\u5efa\u65b0\u7528\u6237:<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"[postgres@server ~$]\">createuser <span class=\"token parameter variable\">--interactive<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u5e0c\u671b\u5728\u4e0d\u5207\u6362\u5230\u60a8\u7684\u5e38\u89c4\u5e10\u6237\u7684\u60c5\u51b5\u4e0b\u4e3a\u6bcf\u4e2a\u547d\u4ee4\u4f7f\u7528sudo\uff0c\u8bf7\u8f93\u5165\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-u<\/span> postgres createuser <span class=\"token parameter variable\">--interactive<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u811a\u672c\u4f1a\u63d0\u793a\u60a8\u9009\u62e9\uff0c\u5e76\u6839\u636e\u60a8\u7684\u56de\u7b54\u6267\u884c\u5fc5\u8981\u7684Postgres\u547d\u4ee4\u4ee5\u521b\u5efa\u7b26\u5408\u60a8\u8981\u6c42\u7684\u7528\u6237\u3002\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u901a\u8fc7\u5728\u63d0\u793a\u65f6\u8f93\u5165y\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aSammy\u7684\u89d2\u8272\uff0c\u5e76\u8d4b\u4e88\u5b83\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div>Enter name of role to add: <mark>sammy<\/mark>\r\nShall the new role be a superuser? (y\/n) <mark>y<\/mark>\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u4f20\u9012\u4e00\u4e9b\u989d\u5916\u7684\u6807\u5fd7\uff0c\u4f60\u53ef\u4ee5\u83b7\u5f97\u66f4\u591a\u7684\u63a7\u5236\u3002\u67e5\u770bcreateuser\u7684man\u9875\u4ee5\u4e86\u89e3\u9009\u9879\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">man<\/span> createuser\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u60a8\u7684Postgres\u5b89\u88c5\u73b0\u5728\u6709\u4e00\u4e2a\u65b0\u7684\u89d2\u8272\uff0c\u4f46\u662f\u60a8\u8fd8\u6ca1\u6709\u6dfb\u52a0\u4efb\u4f55\u6570\u636e\u5e93\u3002\u63a5\u4e0b\u6765\u7684\u90e8\u5206\u5c06\u63cf\u8ff0\u6b64\u8fc7\u7a0b\u3002<\/p>\n<h2>\u7b2c\u4e94\u6b65 &#8211; \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93<\/h2>\n<p>PostgreSQL\u7684\u8eab\u4efd\u9a8c\u8bc1\u7cfb\u7edf\u9ed8\u8ba4\u5047\u8bbe\u662f\uff0c\u4efb\u4f55\u7528\u4e8e\u767b\u5f55\u7684\u89d2\u8272\u90fd\u5177\u6709\u5bf9\u540c\u540d\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740\uff0c\u5982\u679c\u4f60\u5728\u4e0a\u4e00\u8282\u521b\u5efa\u7684\u7528\u6237\u53eb\u505aSammy\uff0c\u90a3\u6743\u9650\u89d2\u8272\u4f1a\u9ed8\u8ba4\u5c1d\u8bd5\u8fde\u63a5\u5230\u4e00\u4e2a\u4e5f\u53ebSammy\u7684\u6570\u636e\u5e93\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528createdb\u547d\u4ee4\u6765\u521b\u5efa\u8fd9\u6837\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4ee5postgres\u8d26\u6237\u767b\u5f55\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u7c7b\u4f3c\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"[postgres@server ~$]\">createdb <mark>sammy<\/mark>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u66f4\u559c\u6b22\u5728\u4e0d\u5207\u6362\u5230\u666e\u901a\u8d26\u6237\u7684\u60c5\u51b5\u4e0b\uff0c\u5bf9\u6bcf\u4e2a\u547d\u4ee4\u4f7f\u7528sudo\uff0c\u5219\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-u<\/span> postgres createdb <mark>sammy<\/mark>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u7075\u6d3b\u6027\u63d0\u4f9b\u4e86\u6839\u636e\u9700\u8981\u521b\u5efa\u6570\u636e\u5e93\u7684\u591a\u79cd\u65b9\u6cd5\u7684\u9009\u62e9\u3002<\/p>\n<p>\u73b0\u5728\u60a8\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\uff0c\u60a8\u5c06\u4f7f\u7528\u60a8\u7684\u65b0\u89d2\u8272\u767b\u5f55\u3002<\/p>\n<h2>\u7b2c\u516d\u6b65-\u4f7f\u7528\u65b0\u7684\u89d2\u8272\u6253\u5f00Postgres\u63d0\u793a\u7b26\u3002<\/h2>\n<p>\u4e3a\u4e86\u4f7f\u7528ident\u8eab\u4efd\u9a8c\u8bc1\u767b\u5f55\uff0c\u60a8\u9700\u8981\u4e00\u4e2a\u4e0e\u60a8\u7684Postgres\u89d2\u8272\u548c\u6570\u636e\u5e93\u540d\u79f0\u76f8\u540c\u7684Linux\u7528\u6237\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6ca1\u6709\u5339\u914d\u7684Linux\u7528\u6237\u53ef\u7528\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528adduser\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u3002\u60a8\u9700\u8981\u5728\u5177\u6709sudo\u7279\u6743\u7684\u975eroot\u5e10\u6237\u4e0a\u6267\u884c\u6b64\u64cd\u4f5c\uff08\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e0d\u8981\u4ee5postgres\u7528\u6237\u767b\u5f55\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> adduser <mark>sammy<\/mark>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u4e00\u65e6\u8fd9\u4e2a\u65b0\u5e10\u6237\u53ef\u7528\uff0c\u60a8\u53ef\u4ee5\u9009\u62e9\u5207\u6362\u5e76\u9996\u5148\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token parameter variable\">-u<\/span> <mark>sammy<\/mark>\r\n<\/li><li data-prefix=\"$\">psql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u6216\u8005\uff0c\u4f60\u53ef\u4ee5\u5185\u5d4c\u5730\u8fdb\u884c\u8fd9\u4e2a\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-u<\/span> <mark>sammy<\/mark> psql\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u4f1a\u81ea\u52a8\u767b\u5f55\u4f60\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5e0c\u671b\u7528\u6237\u8fde\u63a5\u5230\u4e0d\u540c\u7684\u6570\u636e\u5e93\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5305\u62ec\u201c-d\u201d\u6807\u5fd7\u5e76\u6307\u5b9a\u6570\u636e\u5e93\u6765\u5b9e\u73b0\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"[sammy@server ~$]\">psql <span class=\"token parameter variable\">-d<\/span> <mark>sammy<\/mark>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u4e00\u65e6\u767b\u5f55\u6210\u529f\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\u6765\u67e5\u770b\u4f60\u5f53\u524d\u7684\u8fde\u63a5\u4fe1\u606f\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\"><span class=\"token punctuation\">\\<\/span>conninfo\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u663e\u793a\u4ee5\u4e0b\u7684\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div>You are connected to database \"<mark>sammy<\/mark>\" as user \"<mark>sammy<\/mark>\" via socket in \"\/var\/run\/postgresql\" at port \"5432\".\r\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u8fde\u63a5\u975e\u9ed8\u8ba4\u6570\u636e\u5e93\u6216\u4e0e\u975e\u9ed8\u8ba4\u7528\u6237\u8fdb\u884c\u8fde\u63a5\uff0c\u8fd9\u5c06\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p>\u8fde\u63a5\u5230\u60a8\u7684\u6570\u636e\u5e93\u540e\uff0c\u60a8\u73b0\u5728\u53ef\u4ee5\u5c1d\u8bd5\u521b\u5efa\u548c\u5220\u9664\u8868\u683c\u3002<\/p>\n<h2>\u7b2c\u4e03\u6b65 &#8211; \u521b\u5efa\u548c\u5220\u9664\u8868<\/h2>\n<p>\u73b0\u5728\u4f60\u77e5\u9053\u5982\u4f55\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u4f60\u53ef\u4ee5\u5b66\u4e60\u4e00\u4e9b\u57fa\u672c\u7684Postgres\u7ba1\u7406\u4efb\u52a1\u3002<\/p>\n<p>\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2a\u8868\u683c\u6765\u5b58\u50a8\u4e00\u4e9b\u6570\u636e\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u5c06\u521b\u5efa\u4e00\u4e2a\u63cf\u8ff0\u4e00\u4e9b\u6e38\u4e50\u8bbe\u5907\u7684\u8868\u683c\u3002<\/p>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7684\u57fa\u672c\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code>CREATE TABLE <mark>table_name<\/mark> (\r\n    <mark>column_name1 col_type<\/mark> (<mark>field_length<\/mark>) <mark>column_constraints<\/mark>,\r\n    <mark>column_name2 col_type<\/mark> (<mark>field_length<\/mark>),\r\n    <mark>column_name3 col_type<\/mark> (<mark>field_length<\/mark>)\r\n);\r\n<\/code><\/pre>\n<p>\u8fd9\u4e9b\u547d\u4ee4\u7ed9\u8868\u683c\u547d\u540d\uff0c\u5e76\u5b9a\u4e49\u5217\u3001\u5217\u7c7b\u578b\u4ee5\u53ca\u5b57\u6bb5\u6570\u636e\u7684\u6700\u5927\u957f\u5ea6\u3002\u60a8\u8fd8\u53ef\u4ee5\u9009\u62e9\u6027\u5730\u4e3a\u6bcf\u5217\u6dfb\u52a0\u8868\u683c\u7ea6\u675f\u3002<\/p>\n<p>\u4e3a\u4e86\u6f14\u793a\u76ee\u7684\uff0c\u521b\u5efa\u4e00\u4e2a\u50cf\u8fd9\u6837\u7684\u8868\u683c\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">CREATE TABLE playground <span class=\"token punctuation\">(<\/span>\r\n<\/li><li data-prefix=\"sammy=#\">    equip_id serial PRIMARY KEY,\r\n<\/li><li data-prefix=\"sammy=#\">    <span class=\"token builtin class-name\">type<\/span> varchar <span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span> NOT NULL,\r\n<\/li><li data-prefix=\"sammy=#\">    color varchar <span class=\"token punctuation\">(<\/span><span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span> NOT NULL,\r\n<\/li><li data-prefix=\"sammy=#\">    location varchar<span class=\"token punctuation\">(<\/span><span class=\"token number\">25<\/span><span class=\"token punctuation\">)<\/span> check <span class=\"token punctuation\">(<\/span>location <span class=\"token keyword\">in<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token string\">'north'<\/span>, <span class=\"token string\">'south'<\/span>, <span class=\"token string\">'west'<\/span>, <span class=\"token string\">'east'<\/span>, <span class=\"token string\">'northeast'<\/span>, <span class=\"token string\">'southeast'<\/span>, <span class=\"token string\">'southwest'<\/span>, <span class=\"token string\">'northwest'<\/span><span class=\"token punctuation\">))<\/span>,\r\n<\/li><li data-prefix=\"sammy=#\">    install_date <span class=\"token function\">date<\/span>\r\n<\/li><li data-prefix=\"sammy=#\"><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u5c06\u521b\u5efa\u4e00\u4e2a\u8bb0\u8f7d\u6e38\u4e50\u573a\u8bbe\u5907\u7684\u8868\u3002\u5b83\u4ee5\u8bbe\u5907ID\u4e3a\u8d77\u70b9\uff0c\u8bbe\u5907ID\u7684\u7c7b\u578b\u662f\u5e8f\u5217\u7c7b\u578b\u3002\u8fd9\u4e2a\u6570\u636e\u7c7b\u578b\u662f\u81ea\u589e\u7684\u6574\u6570\u3002\u4f60\u8fd8\u8d4b\u4e88\u4e86\u8fd9\u5217\u4e3b\u952e\u7684\u7ea6\u675f\uff0c\u610f\u5473\u7740\u503c\u5fc5\u987b\u662f\u552f\u4e00\u4e14\u975e\u7a7a\u7684\u3002<\/p>\n<p>\u5bf9\u4e8e\u4e24\u4e2a\u5217\uff08equip_id\u548cinstall_date\uff09\uff0c\u8be5\u547d\u4ee4\u6ca1\u6709\u6307\u5b9a\u5b57\u6bb5\u957f\u5ea6\u3002\u8fd9\u662f\u56e0\u4e3a\u67d0\u4e9b\u5217\u7c7b\u578b\u4e0d\u9700\u8981\u8bbe\u7f6e\u957f\u5ea6\uff0c\u56e0\u4e3a\u957f\u5ea6\u662f\u7531\u7c7b\u578b\u9690\u542b\u7684\u3002<\/p>\n<p>\u4e0b\u9762\u7684\u4e24\u884c\u5206\u522b\u521b\u5efa\u8bbe\u5907\u7c7b\u578b\u548c\u989c\u8272\u7684\u5217\uff0c\u6bcf\u4e2a\u5217\u90fd\u4e0d\u80fd\u4e3a\u7a7a\u3002\u5728\u8fd9\u4e9b\u884c\u4e4b\u540e\uff0c\u521b\u5efa\u4e86\u4e00\u4e2a\u4f4d\u7f6e\u5217\u548c\u4e00\u4e2a\u7ea6\u675f\u6761\u4ef6\uff0c\u8981\u6c42\u503c\u5fc5\u987b\u662f\u516b\u4e2a\u53ef\u80fd\u7684\u503c\u4e4b\u4e00\u3002\u6700\u540e\u4e00\u884c\u521b\u5efa\u4e86\u4e00\u4e2a\u65e5\u671f\u5217\uff0c\u8bb0\u5f55\u5b89\u88c5\u8bbe\u5907\u7684\u65e5\u671f\u3002<\/p>\n<p>\u901a\u8fc7\u8f93\u5165\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u60a8\u7684\u65b0\u684c\u5b50\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\"><span class=\"token punctuation\">\\<\/span>d\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u663e\u793a\u4ee5\u4e0b\u8f93\u51fa:<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div>                  List of relations\r\n Schema |          Name           |   Type   | Owner \r\n--------+-------------------------+----------+-------\r\n public | playground              | table    | sammy\r\n public | playground_equip_id_seq | sequence | sammy\r\n(2 rows)\r\n<\/code><\/pre>\n<p>\u4f60\u7684\u6e38\u4e50\u573a\u684c\u5b50\u5728\u8fd9\u91cc\uff0c\u4f46\u8fd8\u6709\u4e00\u4e2a\u53eb\u505aplayground_equip_id_seq\u7684\u4e1c\u897f\uff0c\u5b83\u662f\u5e8f\u5217\u7c7b\u578b\u3002\u8fd9\u662f\u4f60\u7ed9equip_id\u5217\u7684\u4e00\u4e2a\u5e8f\u5217\u7c7b\u578b\u7684\u8868\u793a\u3002\u5b83\u4f1a\u8ddf\u8e2a\u4e0b\u4e00\u4e2a\u5e8f\u5217\u4e2d\u7684\u6570\u5b57\uff0c\u5e76\u4e14\u4f1a\u81ea\u52a8\u4e3a\u6b64\u7c7b\u578b\u7684\u5217\u521b\u5efa\u3002<\/p>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u770b\u5230\u8868\u683c\u800c\u4e0d\u5305\u542b\u5e8f\u5217\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\"><span class=\"token punctuation\">\\<\/span>dt\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u6b64\u5c06\u4ea7\u751f\u4ee5\u4e0b\u7ed3\u679c:<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div>          List of relations\r\n Schema |    Name    | Type  | Owner \r\n--------+------------+-------+-------\r\n public | playground | table | sammy\r\n(1 row)\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u4e00\u6b65\u4e2d\uff0c\u4f60\u521b\u5efa\u4e86\u4e00\u4e2a\u6837\u672c\u8868\u3002\u5728\u4e0b\u4e00\u6b65\u4e2d\uff0c\u4f60\u5c06\u5c1d\u8bd5\u5728\u8be5\u8868\u4e2d\u6dfb\u52a0\u3001\u67e5\u8be2\u548c\u5220\u9664\u6761\u76ee\u3002<\/p>\n<h2>\u7b2c\u516b\u6b65 &#8211; \u5728\u8868\u4e2d\u6dfb\u52a0\u3001\u67e5\u8be2\u548c\u5220\u9664\u6570\u636e<\/h2>\n<p>\u73b0\u5728\u4f60\u6709\u4e86\u4e00\u4e2a\u8868\uff0c\u4f60\u53ef\u4ee5\u5411\u5176\u4e2d\u63d2\u5165\u4e00\u4e9b\u6570\u636e\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u901a\u8fc7\u8c03\u7528\u8981\u6dfb\u52a0\u7684\u8868\u683c\uff0c\u7ed9\u6bcf\u4e00\u5217\u547d\u540d\uff0c\u5e76\u4e3a\u6bcf\u4e00\u5217\u63d0\u4f9b\u6570\u636e\uff0c\u6765\u6dfb\u52a0\u4e00\u4e2a\u5e7b\u706f\u7247\u548c\u4e00\u4e2a\u79cb\u5343\uff0c\u5c31\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">INSERT INTO playground <span class=\"token punctuation\">(<\/span>type, color, location, install_date<span class=\"token punctuation\">)<\/span> VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">'slide'<\/span>, <span class=\"token string\">'blue'<\/span>, <span class=\"token string\">'south'<\/span>, <span class=\"token string\">'2017-04-28'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><li data-prefix=\"sammy=#\">INSERT INTO playground <span class=\"token punctuation\">(<\/span>type, color, location, install_date<span class=\"token punctuation\">)<\/span> VALUES <span class=\"token punctuation\">(<\/span><span class=\"token string\">'swing'<\/span>, <span class=\"token string\">'yellow'<\/span>, <span class=\"token string\">'northwest'<\/span>, <span class=\"token string\">'2018-08-16'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5728\u8f93\u5165\u6570\u636e\u65f6\uff0c\u4f60\u5e94\u5f53\u5c0f\u5fc3\u4ee5\u907f\u514d\u4e00\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\u3002\u9996\u5148\uff0c\u4e0d\u8981\u5c06\u5217\u540d\u7528\u5f15\u53f7\u62ec\u8d77\u6765\uff0c\u53ea\u9700\u8981\u5c06\u5217\u7684\u503c\u7528\u5f15\u53f7\u62ec\u8d77\u6765\u3002<\/p>\n<p>\u53e6\u4e00\u4ef6\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u60a8\u4e0d\u9700\u8981\u4e3aequip_id\u5217\u8f93\u5165\u503c\u3002\u8fd9\u662f\u56e0\u4e3a\u5728\u521b\u5efa\u65b0\u884c\u65f6\uff0c\u5b83\u4f1a\u81ea\u52a8\u751f\u6210\u3002<\/p>\n<p>\u901a\u8fc7\u952e\u5165\u68c0\u7d22\u60a8\u6dfb\u52a0\u7684\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">SELECT * FROM playground<span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u60a8\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u7684\u8f93\u51fa\u7ed3\u679c:<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div> equip_id | type  | color  | location  | install_date \r\n----------+-------+--------+-----------+--------------\r\n        1 | slide | blue   | south     | 2017-04-28\r\n        2 | swing | yellow | northwest | 2018-08-16\r\n(2 rows)\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u91cc\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u4f60\u7684\u8bbe\u5907\u7f16\u53f7\u5df2\u7ecf\u6210\u529f\u586b\u5199\uff0c\u5e76\u4e14\u4f60\u7684\u5176\u4ed6\u6570\u636e\u90fd\u5df2\u6b63\u786e\u7ec4\u7ec7\u3002<\/p>\n<p>\u5982\u679c\u64cd\u573a\u4e0a\u7684\u6ed1\u68af\u574f\u4e86\uff0c\u4f60\u9700\u8981\u79fb\u9664\u5b83\uff0c\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u6765\u5220\u9664\u4f60\u684c\u5b50\u4e0a\u7684\u884c\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">DELETE FROM playground WHERE <span class=\"token builtin class-name\">type<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'slide'<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u518d\u6b21\u67e5\u8be2\u8868\u683c<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">SELECT * FROM playground<span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u4f60\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div> equip_id | type  | color  | location  | install_date \r\n----------+-------+--------+-----------+--------------\r\n        2 | swing | yellow | northwest | 2018-08-16\r\n(1 row)\r\n<\/code><\/pre>\n<p>\u8bf7\u6ce8\u610f\uff0c\u4f60\u7684\u5e7b\u706f\u7247\u4e0d\u518d\u662f\u8868\u683c\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p>\u65e2\u7136\u4f60\u5df2\u7ecf\u5728\u8868\u683c\u4e2d\u6dfb\u52a0\u548c\u5220\u9664\u4e86\u6761\u76ee\uff0c\u73b0\u5728\u53ef\u4ee5\u5c1d\u8bd5\u6dfb\u52a0\u548c\u5220\u9664\u5217\u3002<\/p>\n<h2>\u7b2c\u4e5d\u6b65 &#8211; \u5411\u8868\u4e2d\u6dfb\u52a0\u548c\u5220\u9664\u5217<\/h2>\n<p>\u521b\u5efa\u8868\u540e\uff0c\u60a8\u53ef\u4ee5\u4fee\u6539\u5b83\u6765\u6dfb\u52a0\u6216\u5220\u9664\u5217\u3002\u901a\u8fc7\u8f93\u5165\uff0c\u4e3a\u6bcf\u4e2a\u8bbe\u5907\u6dfb\u52a0\u4e00\u5217\u4ee5\u663e\u793a\u6700\u540e\u4e00\u6b21\u7ef4\u62a4\u8bbf\u95ee\u7684\u65e5\u671f\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">ALTER TABLE playground ADD last_maint <span class=\"token function\">date<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u518d\u6b21\u67e5\u770b\u60a8\u7684\u8868\u683c\u4fe1\u606f\uff0c\u60a8\u4f1a\u770b\u5230\u65b0\u7684\u5217\u5df2\u7ecf\u6dfb\u52a0\uff08\u4f46\u6ca1\u6709\u6570\u636e\u8f93\u5165\uff09\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">SELECT * FROM playground<span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u4f60\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div> equip_id | type  | color  | location  | install_date | last_maint \r\n----------+-------+--------+-----------+--------------+------------\r\n        2 | swing | yellow | northwest | 2018-08-16   | \r\n(1 row)\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u53d1\u73b0\u4f60\u7684\u5de5\u4f5c\u56e2\u961f\u4f7f\u7528\u5355\u72ec\u7684\u5de5\u5177\u6765\u8bb0\u5f55\u7ef4\u62a4\u5386\u53f2\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\u6765\u5220\u9664\u8be5\u680f\u76ee\uff1a<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">ALTER TABLE playground DROP last_maint<span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u5220\u9664last_maint\u5217\u53ca\u5176\u5185\u90e8\u7684\u4efb\u4f55\u6570\u503c\uff0c\u4f46\u4fdd\u7559\u6240\u6709\u5176\u4ed6\u6570\u636e\u4e0d\u53d8\u3002<\/p>\n<p>\u5728\u73b0\u5728\u5df2\u7ecf\u6dfb\u52a0\u548c\u5220\u9664\u4e86\u5217\u4e4b\u540e\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u5728\u6700\u540e\u4e00\u6b65\u66f4\u65b0\u73b0\u6709\u6570\u636e\u3002<\/p>\n<h2>\u7b2c\u5341\u6b65\u2014\u2014\u66f4\u65b0\u8868\u4e2d\u7684\u6570\u636e<\/h2>\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u4f60\u5df2\u7ecf\u5b66\u4f1a\u4e86\u5982\u4f55\u5411\u8868\u4e2d\u6dfb\u52a0\u8bb0\u5f55\u548c\u5220\u9664\u8bb0\u5f55\uff0c\u4f46\u662f\u8fd9\u4e2a\u6559\u7a0b\u8fd8\u6ca1\u6709\u6d89\u53ca\u5982\u4f55\u4fee\u6539\u5df2\u6709\u7684\u6761\u76ee\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u67e5\u8be2\u8981\u66f4\u65b0\u7684\u8bb0\u5f55\uff0c\u5e76\u5c06\u5217\u8bbe\u7f6e\u4e3a\u60a8\u60f3\u4f7f\u7528\u7684\u503c\u6765\u66f4\u65b0\u73b0\u6709\u6761\u76ee\u7684\u503c\u3002\u60a8\u53ef\u4ee5\u67e5\u8be2\u6447\u6446\u8bb0\u5f55\uff08\u8fd9\u5c06\u5339\u914d\u8868\u4e2d\u7684\u6bcf\u4e2a\u6447\u6446\uff09\u5e76\u5c06\u5176\u989c\u8272\u66f4\u6539\u4e3a\u7ea2\u8272\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">UPDATE playground SET color <span class=\"token operator\">=<\/span> <span class=\"token string\">'red'<\/span> WHERE <span class=\"token builtin class-name\">type<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'swing'<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u518d\u6b21\u67e5\u8be2\u6570\u636e\uff0c\u60a8\u53ef\u4ee5\u9a8c\u8bc1\u64cd\u4f5c\u662f\u5426\u6210\u529f\u3002<\/p>\n<pre class=\"post-pre\"><code><ol><li data-prefix=\"sammy=#\">SELECT * FROM playground<span class=\"token punctuation\">;<\/span>\r\n<\/li><\/ol>\r\n<\/code><\/pre>\n<p>\u4f60\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre class=\"post-pre\"><code><div class=\"secondary-code-label\" title=\"Output\">Output<\/div> equip_id | type  | color | location  | install_date \r\n----------+-------+-------+-----------+--------------\r\n        2 | swing | red   | northwest | 2010-08-16\r\n(1 row)\r\n<\/code><\/pre>\n<p>\u6b63\u5982\u4f60\u6240\u89c1\uff0c\u4f60\u7684\u5e7b\u706f\u7247\u73b0\u5728\u88ab\u8bc6\u522b\u4e3a\u7ea2\u8272\u3002<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u60a8\u73b0\u5728\u5df2\u5728\u60a8\u7684Rocky Linux 9\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e\u597d\u4e86PostgreSQL\u3002\u7136\u800c\uff0c\u8fd8\u6709\u5f88\u591a\u5173\u4e8ePostgres\u7684\u77e5\u8bc6\u9700\u8981\u5b66\u4e60\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u66f4\u591a\u6307\u5357\uff0c\u6db5\u76d6\u4e86\u5982\u4f55\u4f7f\u7528Postgres\u7684\u5185\u5bb9\u3002<\/p>\n<ul class=\"post-ul\">\n<li>A comparison of relational database management systems<\/li>\n<li>Learn about running queries in PostgreSQL<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00 \u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u8bb8\u591a\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u5e8f\u7684\u5b58\u50a8\u3001\u7ec4\u7ec7\u548c\u8bbf\u95ee\u4fe1\u606f\u7684\u65b9\u5f0f\u3002 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-50738","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728rocky-linux-9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL\" \/>\n<meta property=\"og:description\" content=\"\u5f15\u8a00 \u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u8bb8\u591a\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u5e8f\u7684\u5b58\u50a8\u3001\u7ec4\u7ec7\u548c\u8bbf\u95ee\u4fe1\u606f\u7684\u65b9\u5f0f\u3002 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728rocky-linux-9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-23T02:31:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-23T07:27:38+00:00\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/\",\"name\":\"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-23T02:31:40+00:00\",\"dateModified\":\"2023-12-23T07:27:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728rocky-linux-9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528postgresql\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL","og_description":"\u5f15\u8a00 \u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u8bb8\u591a\u7f51\u7ad9\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e00\u79cd\u6709\u5e8f\u7684\u5b58\u50a8\u3001\u7ec4\u7ec7\u548c\u8bbf\u95ee\u4fe1\u606f\u7684\u65b9\u5f0f\u3002 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5982\u4f55\u5728rocky-linux-9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528postgresql\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-23T02:31:40+00:00","article_modified_time":"2023-12-23T07:27:38+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/","name":"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-23T02:31:40+00:00","dateModified":"2023-12-23T07:27:38+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728Rocky Linux 9\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528PostgreSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%a6%82%e4%bd%95%e5%9c%a8rocky-linux-9%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e4%bd%bf%e7%94%a8postgresql\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/50738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=50738"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/50738\/revisions"}],"predecessor-version":[{"id":50792,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/50738\/revisions\/50792"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=50738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=50738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=50738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}