{"id":2685,"date":"2025-03-12T23:47:19","date_gmt":"2025-03-12T15:47:19","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=2685"},"modified":"2025-03-12T23:47:19","modified_gmt":"2025-03-12T15:47:19","slug":"postgresql-lock%ef%bc%88%e9%94%81%ef%bc%89%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/12\/postgresql-lock%ef%bc%88%e9%94%81%ef%bc%89%e8%af%a6%e8%a7%a3\/","title":{"rendered":"PostgreSQL LOCK\uff08\u9501\uff09\u8be6\u89e3"},"content":{"rendered":"\n<p><strong>\u9501<\/strong>\uff08Lock\uff09\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08DBMS\uff09\u7528\u6765\u63a7\u5236\u591a\u4e2a\u4e8b\u52a1\u5e76\u53d1\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\u7684\u673a\u5236\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\u3002PostgreSQL \u4f7f\u7528\u9501\u6765\u7ba1\u7406\u4e8b\u52a1\u4e4b\u95f4\u7684\u5e76\u53d1\u64cd\u4f5c\uff0c\u907f\u514d\u6570\u636e\u51b2\u7a81\u548c\u4e0d\u4e00\u81f4\u3002<\/p>\n\n\n\n<p>\u5728 PostgreSQL \u4e2d\uff0c\u9501\u7684\u673a\u5236\u4e3b\u8981\u7528\u4e8e\u5b9e\u73b0\u6570\u636e\u7684 <strong>\u5e76\u53d1\u63a7\u5236<\/strong>\uff0c\u786e\u4fdd\u591a\u4e2a\u4e8b\u52a1\u5728\u8bbf\u95ee\u5171\u4eab\u6570\u636e\u65f6\u80fd\u591f\u6b63\u786e\u540c\u6b65\u3002\u9501\u7684\u7c7b\u578b\u4e3b\u8981\u5305\u62ec\u884c\u7ea7\u9501\u548c\u8868\u7ea7\u9501\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. \u9501\u7684\u5206\u7c7b<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1 \u884c\u7ea7\u9501\uff08Row-level Locks\uff09<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u884c\u7ea7\u9501\u662f Postgres \u4e2d\u6700\u5e38\u7528\u7684\u9501\u7c7b\u578b\u3002\u5b83\u5141\u8bb8\u591a\u4e2a\u4e8b\u52a1\u5e76\u53d1\u8bbf\u95ee\u540c\u4e00\u8868\u4e2d\u7684\u4e0d\u540c\u884c\u3002\u884c\u7ea7\u9501\u7684\u4f18\u70b9\u662f\u63d0\u9ad8\u4e86\u5e76\u53d1\u6027\u80fd\uff0c\u56e0\u4e3a\u5b83\u4e0d\u9501\u4f4f\u6574\u4e2a\u8868\uff0c\u53ea\u9501\u5b9a\u6b63\u5728\u4fee\u6539\u6216\u67e5\u8be2\u7684\u884c\u3002 <strong>\u5e38\u89c1\u7684\u884c\u7ea7\u9501\u7c7b\u578b\uff1a<\/strong><\/li>\n\n\n\n<li><strong>FOR UPDATE<\/strong>\uff1a\u5728 SELECT \u67e5\u8be2\u4e2d\u6dfb\u52a0\u6b64\u9009\u9879\uff0c\u9501\u5b9a\u67e5\u8be2\u8fd4\u56de\u7684\u884c\u3002<\/li>\n\n\n\n<li><strong>FOR SHARE<\/strong>\uff1a\u4e0e <code>FOR UPDATE<\/code> \u7c7b\u4f3c\uff0c\u4f46\u5b83\u5141\u8bb8\u5176\u4ed6\u4e8b\u52a1\u5bf9\u9501\u5b9a\u7684\u884c\u8fdb\u884c\u5171\u4eab\u8bfb\u53d6\u3002 <strong>\u793a\u4f8b<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  BEGIN;\n\n  -- \u9501\u5b9a \"employees\" \u8868\u4e2d\u6240\u6709 \"HR\" \u90e8\u95e8\u7684\u5458\u5de5\u884c\n  SELECT * FROM employees WHERE department = 'HR' FOR UPDATE;\n\n  -- \u6267\u884c\u5176\u4ed6\u64cd\u4f5c...\n  COMMIT;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.2 \u8868\u7ea7\u9501\uff08Table-level Locks\uff09<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8868\u7ea7\u9501\u662f\u5bf9\u6574\u4e2a\u8868\u7684\u9501\u5b9a\uff0c\u901a\u5e38\u5728\u9700\u8981\u6267\u884c DDL \u64cd\u4f5c\uff08\u5982 ALTER TABLE\u3001DROP TABLE \u7b49\uff09\u65f6\u4f7f\u7528\u3002\u8868\u7ea7\u9501\u5c06\u9632\u6b62\u5176\u4ed6\u4e8b\u52a1\u5728\u540c\u4e00\u65f6\u523b\u5bf9\u8be5\u8868\u8fdb\u884c\u4efb\u4f55\u4fee\u6539\u6216\u8bbf\u95ee\u3002 <strong>\u5e38\u89c1\u7684\u8868\u7ea7\u9501\u7c7b\u578b\uff1a<\/strong><\/li>\n\n\n\n<li><strong>ACCESS SHARE LOCK<\/strong>\uff1a\u67e5\u8be2\u64cd\u4f5c\u7684\u9ed8\u8ba4\u9501\u7ea7\u522b\uff0c\u5141\u8bb8\u5176\u4ed6\u4e8b\u52a1\u8bfb\u53d6\u8868\u4e2d\u7684\u6570\u636e\uff0c\u4f46\u4e0d\u80fd\u4fee\u6539\u3002<\/li>\n\n\n\n<li><strong>ROW EXCLUSIVE LOCK<\/strong>\uff1a\u901a\u5e38\u5728\u63d2\u5165\u3001\u66f4\u65b0\u3001\u5220\u9664\u64cd\u4f5c\u65f6\u4f7f\u7528\u3002<\/li>\n\n\n\n<li><strong>SHARE LOCK<\/strong>\uff1a\u5141\u8bb8\u5176\u4ed6\u4e8b\u52a1\u8bfb\u53d6\u6570\u636e\uff0c\u4f46\u4e0d\u80fd\u4fee\u6539\u3002<\/li>\n\n\n\n<li><strong>EXCLUSIVE LOCK<\/strong>\uff1a\u963b\u6b62\u4efb\u4f55\u5176\u4ed6\u4e8b\u52a1\u5bf9\u8be5\u8868\u8fdb\u884c\u8bfb\u53d6\u6216\u4fee\u6539\u3002<\/li>\n\n\n\n<li><strong>ACCESS EXCLUSIVE LOCK<\/strong>\uff1a\u7528\u4e8e\u5bf9\u8868\u8fdb\u884c\u7ed3\u6784\u6027\u4fee\u6539\uff08\u5982 DROP TABLE\u3001ALTER TABLE\uff09\u65f6\u4f7f\u7528\uff0c\u80fd\u591f\u5b8c\u5168\u963b\u6b62\u5bf9\u8868\u7684\u8bbf\u95ee\u3002 <strong>\u793a\u4f8b<\/strong>\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  BEGIN;\n\n  -- \u83b7\u53d6\u8868\u7ea7\u9501\uff0c\u6267\u884c\u66f4\u65b0\u64cd\u4f5c\n  LOCK TABLE employees IN EXCLUSIVE MODE;\n\n  -- \u6267\u884c\u5176\u4ed6\u64cd\u4f5c...\n  COMMIT;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.3 \u610f\u5411\u9501\uff08Intent Locks\uff09<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u610f\u5411\u9501\u662f\u4e3a\u4e86\u5728\u884c\u7ea7\u9501\u548c\u8868\u7ea7\u9501\u4e4b\u95f4\u5efa\u7acb\u4e00\u4e2a\u5c42\u6b21\u7ed3\u6784\u3002\u5b83\u5141\u8bb8\u7cfb\u7edf\u77e5\u9053\u5728\u67d0\u4e2a\u8868\u4e0a\u662f\u5426\u6709\u884c\u7ea7\u9501\u6216\u8868\u7ea7\u9501\u7684\u8bf7\u6c42\uff0c\u4ee5\u4fbf\u907f\u514d\u6b7b\u9501\u3002 <strong>\u793a\u4f8b<\/strong>\uff1a<br>PostgreSQL \u4f1a\u81ea\u52a8\u4f7f\u7528\u610f\u5411\u9501\uff08\u5982 <code>ROW EXCLUSIVE<\/code>\uff09\u6765\u534f\u8c03\u4e0d\u540c\u4e8b\u52a1\u5bf9\u8868\u7684\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. \u9501\u7684\u83b7\u53d6\u4e0e\u91ca\u653e<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1 \u9501\u7684\u83b7\u53d6<\/strong><\/h3>\n\n\n\n<p>\u9501\u4f1a\u5728\u4e8b\u52a1\u5f00\u59cb\u65f6\u81ea\u52a8\u83b7\u53d6\uff0c\u901a\u5e38\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9690\u5f0f\u9501<\/strong>\uff1aPostgreSQL \u5728\u8fdb\u884c\u64cd\u4f5c\u65f6\uff08\u5982 <code>SELECT FOR UPDATE<\/code>\u3001<code>INSERT<\/code> \u7b49\uff09\u81ea\u52a8\u83b7\u53d6\u9501\u3002<\/li>\n\n\n\n<li><strong>\u663e\u5f0f\u9501<\/strong>\uff1a\u53ef\u4ee5\u4f7f\u7528 <code>LOCK<\/code> \u547d\u4ee4\u663e\u5f0f\u5730\u8bf7\u6c42\u9501\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- \u663e\u5f0f\u9501\u5b9a\u8868\nLOCK TABLE employees IN ACCESS EXCLUSIVE MODE;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2 \u9501\u7684\u91ca\u653e<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9501\u4f1a\u5728\u4e8b\u52a1\u63d0\u4ea4\u6216\u56de\u6eda\u65f6\u81ea\u52a8\u91ca\u653e\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u4e8b\u52a1\u6ca1\u6709\u63d0\u4ea4\u6216\u56de\u6eda\uff0c\u9501\u5c06\u6301\u7eed\u5b58\u5728\uff0c\u76f4\u5230\u4e8b\u52a1\u7ed3\u675f\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. \u9501\u7684\u51b2\u7a81\u4e0e\u6b7b\u9501<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 \u9501\u51b2\u7a81<\/strong><\/h3>\n\n\n\n<p>\u5f53\u4e24\u4e2a\u4e8b\u52a1\u8bd5\u56fe\u5bf9\u76f8\u540c\u7684\u6570\u636e\u52a0\u9501\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u9501\u51b2\u7a81\u3002PostgreSQL \u4f1a\u6839\u636e\u4e8b\u52a1\u7684\u9694\u79bb\u7ea7\u522b\u548c\u9501\u7684\u7c7b\u578b\u6765\u51b3\u5b9a\u5982\u4f55\u5904\u7406\u8fd9\u4e9b\u51b2\u7a81\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5171\u4eab\u9501\u4e0e\u5171\u4eab\u9501\u51b2\u7a81<\/strong>\uff1a\u591a\u4e2a\u4e8b\u52a1\u53ef\u4ee5\u5171\u4eab\u9501\uff0c\u5141\u8bb8\u5e76\u53d1\u8bfb\u53d6\uff0c\u4f46\u4e0d\u80fd\u4fee\u6539\u6570\u636e\u3002<\/li>\n\n\n\n<li><strong>\u72ec\u5360\u9501\u4e0e\u5171\u4eab\u9501\u51b2\u7a81<\/strong>\uff1a\u72ec\u5360\u9501\u4f1a\u963b\u6b62\u5176\u4ed6\u4e8b\u52a1\u5bf9\u6570\u636e\u7684\u8bfb\u53d6\u548c\u4fee\u6539\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- \u4e8b\u52a1 A\uff1a\u5c1d\u8bd5\u9501\u5b9a\u5458\u5de5\u6570\u636e\nBEGIN;\nSELECT * FROM employees WHERE department = 'HR' FOR UPDATE;\n\n-- \u4e8b\u52a1 B\uff1a\u5c1d\u8bd5\u540c\u65f6\u9501\u5b9a\u540c\u6837\u7684\u6570\u636e\nBEGIN;\nSELECT * FROM employees WHERE department = 'HR' FOR UPDATE; -- \u4f1a\u88ab\u4e8b\u52a1 A \u963b\u585e<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.2 \u6b7b\u9501<\/strong><\/h3>\n\n\n\n<p>\u6b7b\u9501\u53d1\u751f\u5728\u4e24\u4e2a\u6216\u591a\u4e2a\u4e8b\u52a1\u4e92\u76f8\u6301\u6709\u5bf9\u65b9\u6240\u9700\u7684\u9501\uff0c\u5bfc\u81f4\u65e0\u6cd5\u7ee7\u7eed\u6267\u884c\u7684\u60c5\u51b5\u3002PostgreSQL \u4f1a\u68c0\u6d4b\u6b7b\u9501\u5e76\u81ea\u52a8\u56de\u6eda\u5176\u4e2d\u4e00\u4e2a\u4e8b\u52a1\u6765\u89e3\u9664\u6b7b\u9501\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b\u6b7b\u9501<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e8b\u52a1 A \u9501\u5b9a\u884c 1\uff0c\u4e8b\u52a1 B \u9501\u5b9a\u884c 2\u3002<\/li>\n\n\n\n<li>\u4e8b\u52a1 A \u7b49\u5f85\u83b7\u53d6\u884c 2 \u7684\u9501\uff0c\u4e8b\u52a1 B \u7b49\u5f85\u83b7\u53d6\u884c 1 \u7684\u9501\u3002\u6b64\u65f6\u5c31\u53d1\u751f\u4e86\u6b7b\u9501\u3002<\/li>\n<\/ul>\n\n\n\n<p>PostgreSQL \u4f1a\u68c0\u6d4b\u5230\u8fd9\u79cd\u60c5\u51b5\u5e76\u56de\u6eda\u4e00\u4e2a\u4e8b\u52a1\uff0c\u89e3\u9664\u6b7b\u9501\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. \u9501\u7684\u7ba1\u7406<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1 \u67e5\u770b\u9501\u7684\u72b6\u6001<\/strong><\/h3>\n\n\n\n<p>PostgreSQL \u63d0\u4f9b\u4e86\u7cfb\u7edf\u89c6\u56fe <code>pg_locks<\/code> \u6765\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u7684\u9501\u72b6\u6001\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM pg_locks;<\/code><\/pre>\n\n\n\n<p>\u6b64\u89c6\u56fe\u5305\u542b\u6709\u5173\u9501\u7684\u4fe1\u606f\uff0c\u5982\u9501\u7c7b\u578b\u3001\u88ab\u9501\u5b9a\u7684\u8868\u3001\u9501\u5b9a\u7684\u884c\u7b49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.2 \u9501\u7b49\u5f85<\/strong><\/h3>\n\n\n\n<p>\u5982\u679c\u4e00\u4e2a\u4e8b\u52a1\u7b49\u5f85\u9501\uff0c\u5b83\u4f1a\u5728\u9501\u88ab\u91ca\u653e\u4e4b\u524d\u6682\u505c\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u67e5\u8be2 <code>pg_stat_activity<\/code> \u6765\u67e5\u770b\u54ea\u4e9b\u4e8b\u52a1\u6b63\u5728\u7b49\u5f85\u9501\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM pg_stat_activity WHERE waiting = 't';<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. \u9501\u7684\u6700\u4f73\u5b9e\u8df5<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u907f\u514d\u957f\u65f6\u95f4\u6301\u6709\u9501<\/strong>\uff1a\u5c3d\u91cf\u51cf\u5c11\u4e8b\u52a1\u7684\u6267\u884c\u65f6\u95f4\uff0c\u907f\u514d\u957f\u65f6\u95f4\u6301\u6709\u9501\uff0c\u51cf\u5c11\u5176\u4ed6\u4e8b\u52a1\u7684\u7b49\u5f85\u65f6\u95f4\u3002<\/li>\n\n\n\n<li><strong>\u9009\u62e9\u5408\u9002\u7684\u9501\u7ea7\u522b<\/strong>\uff1a\u6839\u636e\u64cd\u4f5c\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u9501\u7ea7\u522b\u3002\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8868\u7ea7\u9501\uff0c\u5c3d\u91cf\u4f7f\u7528\u884c\u7ea7\u9501\u4ee5\u63d0\u9ad8\u5e76\u53d1\u6027\u80fd\u3002<\/li>\n\n\n\n<li><strong>\u9632\u6b62\u6b7b\u9501<\/strong>\uff1a\u786e\u4fdd\u4e8b\u52a1\u6309\u76f8\u540c\u7684\u987a\u5e8f\u83b7\u53d6\u9501\uff0c\u4ee5\u907f\u514d\u6b7b\u9501\u95ee\u9898\u3002\u4fdd\u6301\u7b80\u77ed\u548c\u4e00\u81f4\u7684\u4e8b\u52a1\u5904\u7406\u6d41\u7a0b\u3002<\/li>\n\n\n\n<li><strong>\u5b9a\u671f\u76d1\u63a7\u9501\u7684\u60c5\u51b5<\/strong>\uff1a\u901a\u8fc7 <code>pg_locks<\/code> \u548c <code>pg_stat_activity<\/code> \u7b49\u89c6\u56fe\uff0c\u5b9a\u671f\u68c0\u67e5\u9501\u7684\u60c5\u51b5\uff0c\u4ee5\u4fbf\u65e9\u671f\u53d1\u73b0\u6f5c\u5728\u7684\u6027\u80fd\u95ee\u9898\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6. \u9501\u7684\u793a\u4f8b\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.1 \u884c\u7ea7\u9501\u793a\u4f8b<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>BEGIN;\n\n-- \u9501\u5b9a\u7279\u5b9a\u884c\nSELECT * FROM employees WHERE department = 'HR' FOR UPDATE;\n\n-- \u6267\u884c\u5176\u4ed6\u64cd\u4f5c\nCOMMIT;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.2 \u8868\u7ea7\u9501\u793a\u4f8b<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>BEGIN;\n\n-- \u83b7\u53d6\u8868\u7ea7\u9501\nLOCK TABLE employees IN EXCLUSIVE MODE;\n\n-- \u6267\u884c\u66f4\u65b0\u64cd\u4f5c\nUPDATE employees SET salary = salary + 1000 WHERE department = 'HR';\n\n-- \u63d0\u4ea4\u4e8b\u52a1\nCOMMIT;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.3 \u67e5\u770b\u9501\u7684\u72b6\u6001<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM pg_locks;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\u9501\u662f\u6570\u636e\u5e93\u5e76\u53d1\u63a7\u5236\u7684\u6838\u5fc3\u90e8\u5206\uff0c\u901a\u8fc7\u9002\u5f53\u7684\u9501\u7ba1\u7406\uff0c\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u4e00\u81f4\u6027\u5e76\u63d0\u9ad8\u6027\u80fd\u3002\u66f4\u591a\u8be6\u7ec6\u5185\u5bb9\u8bf7\u5173\u6ce8\u5176\u4ed6\u76f8\u5173\u6587\u7ae0\uff01<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9501\uff08Lock\uff09\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff08DBMS\uff09\u7528\u6765\u63a7\u5236\u591a\u4e2a\u4e8b\u52a1\u5e76\u53d1\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\u7684\u673a\u5236\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u4e00\u81f4\u6027\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[],"class_list":["post-2685","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=2685"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2685\/revisions"}],"predecessor-version":[{"id":2687,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2685\/revisions\/2687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media\/2686"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=2685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=2685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=2685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}