{"id":41631,"date":"2023-07-31T15:37:37","date_gmt":"2023-09-12T19:56:11","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/"},"modified":"2024-01-15T11:04:21","modified_gmt":"2024-01-15T03:04:21","slug":"%e8%a7%a3%e9%94%81postgresql","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/","title":{"rendered":"\u89e3\u9501PostgreSQL"},"content":{"rendered":"<p>\u5728\u5f00\u53d1DataSpider\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u4f1a\u5728\u811a\u672c\u6267\u884c\u4e2d\u53d1\u751f\u9519\u8bef\uff0c\u5bfc\u81f4\u5728\u63d0\u4ea4\u4e8b\u52a1\u4e4b\u524d\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u56e0\u6b64\u5bfc\u81f4PostgreSQL\u88ab\u9501\u5b9a\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u6211\u8fdb\u884c\u4e86\u5982\u4e0b\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p>1. \u4f7f\u7528SQL\u67e5\u8be2\u786e\u8ba4\u81ea\u5df1\u7684\u8fdb\u7a0bID\u3002<br \/>\nSELECT l.pid, l.locktype, l.mode, c.relname, d.datname<br \/>\nFROM pg_locks l<br \/>\nLEFT JOIN pg_class c ON l.relation = c.relfilenode<br \/>\nLEFT JOIN pg_database d ON l.database = d.oid<br \/>\nORDER BY l.pid;<\/p>\n<p>2. \u4f7f\u7528SQL\u7ec8\u6b62\u8fdb\u7a0b\u3002<br \/>\nSELECT pg_terminate_backend(&#8216;\u5728\u6b65\u9aa41\u4e2d\u786e\u8ba4\u7684\u8fdb\u7a0bID&#8217;)<br \/>\n\u203b\u5c3d\u7ba1pg_cancel_backend\u4e0d\u8d77\u4f5c\u7528\uff0c\u4f46\u662f\u53ef\u4ee5\u4f7f\u7528pg_terminate_backend\u7ec8\u6b62\u8fdb\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f00\u53d1DataSpider\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u4f1a\u5728\u811a\u672c\u6267\u884c\u4e2d\u53d1\u751f\u9519\u8bef\uff0c\u5bfc\u81f4\u5728\u63d0\u4ea4\u4e8b\u52a1\u4e4b\u524d\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u56e0\u6b64\u5bfc\u81f4Postg [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41631","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>\u89e3\u9501PostgreSQL - 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\/\u89e3\u9501postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u89e3\u9501PostgreSQL\" \/>\n<meta property=\"og:description\" content=\"\u5728\u5f00\u53d1DataSpider\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u4f1a\u5728\u811a\u672c\u6267\u884c\u4e2d\u53d1\u751f\u9519\u8bef\uff0c\u5bfc\u81f4\u5728\u63d0\u4ea4\u4e8b\u52a1\u4e4b\u524d\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u56e0\u6b64\u5bfc\u81f4Postg [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u89e3\u9501postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-12T19:56:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-15T03:04:21+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/\",\"name\":\"\u89e3\u9501PostgreSQL - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-09-12T19:56:11+00:00\",\"dateModified\":\"2024-01-15T03:04:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u89e3\u9501PostgreSQL\"}]},{\"@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\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u89e3\u9501PostgreSQL - 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\/\u89e3\u9501postgresql\/","og_locale":"zh_CN","og_type":"article","og_title":"\u89e3\u9501PostgreSQL","og_description":"\u5728\u5f00\u53d1DataSpider\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u4f1a\u5728\u811a\u672c\u6267\u884c\u4e2d\u53d1\u751f\u9519\u8bef\uff0c\u5bfc\u81f4\u5728\u63d0\u4ea4\u4e8b\u52a1\u4e4b\u524d\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u56e0\u6b64\u5bfc\u81f4Postg [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u89e3\u9501postgresql\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-09-12T19:56:11+00:00","article_modified_time":"2024-01-15T03:04:21+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/","name":"\u89e3\u9501PostgreSQL - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-09-12T19:56:11+00:00","dateModified":"2024-01-15T03:04:21+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u89e3\u9501PostgreSQL"}]},{"@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\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%a7%a3%e9%94%81postgresql\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41631","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=41631"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41631\/revisions"}],"predecessor-version":[{"id":58879,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41631\/revisions\/58879"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=41631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=41631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=41631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}