{"id":41638,"date":"2023-03-31T02:48:51","date_gmt":"2023-06-03T08:52:57","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/"},"modified":"2024-04-29T21:15:22","modified_gmt":"2024-04-29T13:15:22","slug":"postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/","title":{"rendered":"&#8220;PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631&#8221;"},"content":{"rendered":"<p>\u5728PostgreSQL\u4e2d\uff0c\u6709\u4e00\u4e2a\u65b9\u4fbf\u7684\u8fd0\u7b97\u7b26\u79f0\u4e3aOVERLAPS\uff0c\u7528\u4e8e\u5224\u65ad\u4e24\u4e2a\u65f6\u95f4\u95f4\u9694\u662f\u5426\u91cd\u53e0\u3002<\/p>\n<p>3\u67081\u65e5\u81f33\u670831\u65e5\u4e4b\u95f4<\/p>\n<ul class=\"post-ul\">3\/30\uff5e3\/31\u306f\u91cd\u306a\u308b\uff1f<\/ul>\n<pre class=\"post-pre\"><code>SELECT (DATE '2016-03-01', DATE '2016-03-31') OVERLAPS\r\n       (DATE '2016-03-30', DATE '2016-03-31')\r\n=&gt; true\r\n<\/code><\/pre>\n<p>\u55ef\u55ef\u3002<\/p>\n<ul class=\"post-ul\">3\/30\u306f\u91cd\u306a\u308b\uff1f<\/ul>\n<pre class=\"post-pre\"><code>SELECT (DATE '2016-03-01', DATE '2016-03-31') OVERLAPS\r\n       (DATE '2016-03-30', DATE '2016-03-30')\r\n=&gt; true\r\n<\/code><\/pre>\n<p>\u55ef\u55ef\u3002<\/p>\n<ul class=\"post-ul\">3\/1\u306f\u91cd\u306a\u308b\uff1f<\/ul>\n<pre class=\"post-pre\"><code>SELECT (DATE '2016-03-01', DATE '2016-03-31') OVERLAPS\r\n       (DATE '2016-03-01', DATE '2016-03-01')\r\n=&gt; true\r\n<\/code><\/pre>\n<p>\u55ef\u55ef\u3002<\/p>\n<ul class=\"post-ul\">3\/31\u306f\u91cd\u306a\u308b\uff1f<\/ul>\n<pre class=\"post-pre\"><code>SELECT (DATE '2016-03-01', DATE '2016-03-31') OVERLAPS\r\n       (DATE '2016-03-31', DATE '2016-03-31')\r\n=&gt; false\r\n<\/code><\/pre>\n<p>\u55ef\uff1f<\/p>\n<p>\u770b\u8d77\u6765\uff0c\u5982\u679c\uff08\u4ece\uff0c\u5230\uff09\u7684\u65e5\u671f\u76f8\u540c\uff0c\u90a3\u4e48\u5224\u65ad\u5b83\u4eec\u4e0d\u4f1a\u91cd\u53e0\uff0c\u5c31\u597d\u50cf\u5b83\u4eec\u5728\u53e6\u4e00\u7aef\u4e00\u6837\u3002<\/p>\n<h1>\u89e3\u51b3\u65b9\u6cd5 f\u01ce)<\/h1>\n<p>\u4f7f\u7528\u8303\u56f4\u578b\u7684daterange\uff0c\u53ef\u4ee5\u6b63\u786e\u5730\u5224\u65ad\u3002<\/p>\n<pre class=\"post-pre\"><code>SELECT daterange(DATE '2016-03-01', DATE '2016-03-31', '[]') &amp;&amp;\r\n       daterange(DATE '2016-03-31', DATE '2016-03-31', '[]')\r\n=&gt; true\r\n<\/code><\/pre>\n<p>\u6700\u540e\u7684'[]&#8217;\u8868\u793a\u5f00\u59cb\u548c\u7ed3\u675f\u70b9\u90fd\u662f\u95ed\u533a\u95f4\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u662f\u8303\u56f4\u7c7b\u578b\u7684\u8bdd\uff0c\u4e5f\u53ef\u4ee5\u83b7\u53d6\u5171\u540c\u90e8\u5206\u3002<\/p>\n<pre class=\"post-pre\"><code>SELECT daterange(DATE '2016-03-01', DATE '2016-03-31', '[]') *\r\n       daterange(DATE '2016-03-31', DATE '2016-03-31', '[]') \r\n=&gt; [2016-03-31,2016-04-01)\r\n<\/code><\/pre>\n<p>\u6700\u540e\u7684&#8217;)&#8217; \u8868\u793a\u5b83\u662f\u4e00\u4e2a\u5f00\u533a\u95f4\u3002<\/p>\n<h2>\u4f7f\u7528\u533a\u95f4\u8303\u56f4\u578b\u7684\u6ce8\u610f\u4e8b\u9879\u3002<\/h2>\n<p>\u8868\u793a\u6ca1\u6709\u5171\u540c\u90e8\u5206\u7684\u65b9\u5f0f\u4e0d\u662fnull\u6216&#8221;\uff0c\u800c\u662fempty\u3002<\/p>\n<pre class=\"post-pre\"><code>SELECT daterange(DATE '2016-03-01', DATE '2016-03-31', '[]') *\r\n       daterange(DATE '2016-04-01', DATE '2016-04-02', '[]') = 'empty'\r\n=&gt; true\r\n<\/code><\/pre>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cempty\u662f\u6307daterange\u7c7b\u578b\u7684\u7a7a\u503c\u3002<\/p>\n<p>\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u4e3aisempty()\u7684\u51fd\u6570\u3002<\/p>\n<pre class=\"post-pre\"><code>SELECT isempty(daterange(DATE '2016-03-01', DATE '2016-03-31', '[]') *\r\n               daterange(DATE '2016-04-01', DATE '2016-04-02', '[]'))\r\n=&gt; true\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728PostgreSQL\u4e2d\uff0c\u6709\u4e00\u4e2a\u65b9\u4fbf\u7684\u8fd0\u7b97\u7b26\u79f0\u4e3aOVERLAPS\uff0c\u7528\u4e8e\u5224\u65ad\u4e24\u4e2a\u65f6\u95f4\u95f4\u9694\u662f\u5426\u91cd\u53e0\u3002 3\u67081\u65e5\u81f33 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-41638","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>&quot;PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631&quot; - 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\/postgresql\u4e2doverlaps\u51fd\u6570\u7684\u9677\u9631\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&quot;PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631&quot;\" \/>\n<meta property=\"og:description\" content=\"\u5728PostgreSQL\u4e2d\uff0c\u6709\u4e00\u4e2a\u65b9\u4fbf\u7684\u8fd0\u7b97\u7b26\u79f0\u4e3aOVERLAPS\uff0c\u7528\u4e8e\u5224\u65ad\u4e24\u4e2a\u65f6\u95f4\u95f4\u9694\u662f\u5426\u91cd\u53e0\u3002 3\u67081\u65e5\u81f33 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql\u4e2doverlaps\u51fd\u6570\u7684\u9677\u9631\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-03T08:52:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T13:15:22+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u96c5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u96c5\" \/>\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\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/\",\"name\":\"\\\"PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631\\\" - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-06-03T08:52:57+00:00\",\"dateModified\":\"2024-04-29T13:15:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"&#8220;PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631&#8221;\"}]},{\"@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\/41e222757cdd2a3365361328bd79970a\",\"name\":\"\u79d1, \u96c5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u96c5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\"PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631\" - 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\/postgresql\u4e2doverlaps\u51fd\u6570\u7684\u9677\u9631\/","og_locale":"zh_CN","og_type":"article","og_title":"\"PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631\"","og_description":"\u5728PostgreSQL\u4e2d\uff0c\u6709\u4e00\u4e2a\u65b9\u4fbf\u7684\u8fd0\u7b97\u7b26\u79f0\u4e3aOVERLAPS\uff0c\u7528\u4e8e\u5224\u65ad\u4e24\u4e2a\u65f6\u95f4\u95f4\u9694\u662f\u5426\u91cd\u53e0\u3002 3\u67081\u65e5\u81f33 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql\u4e2doverlaps\u51fd\u6570\u7684\u9677\u9631\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-03T08:52:57+00:00","article_modified_time":"2024-04-29T13:15:22+00:00","author":"\u79d1, \u96c5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u96c5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/","name":"\"PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631\" - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-06-03T08:52:57+00:00","dateModified":"2024-04-29T13:15:22+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/41e222757cdd2a3365361328bd79970a"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"&#8220;PostgreSQL\u4e2dOVERLAPS\u51fd\u6570\u7684\u9677\u9631&#8221;"}]},{"@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\/41e222757cdd2a3365361328bd79970a","name":"\u79d1, \u96c5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b2d3e00a7df03689797ebd4af8c5827ba5af936849a71050ec331f4cf902c5d?s=96&d=mm&r=g","caption":"\u79d1, \u96c5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keya\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/postgresql%e4%b8%adoverlaps%e5%87%bd%e6%95%b0%e7%9a%84%e9%99%b7%e9%98%b1\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41638","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=41638"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41638\/revisions"}],"predecessor-version":[{"id":87682,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/41638\/revisions\/87682"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=41638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=41638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=41638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}