title: Can a Postgres daterange include infinity as an upper bound?
body: <p>I can't see how to create a daterange with <code>infinity</code> as an inclusive upper bound. Postgres converts both inputs to an exclusive upper bound:</p>
  
  <pre><code>create table dt_overlap (
      id serial primary key,
      validity daterange not null
  );
  
  insert into dt_overlap (validity) values
      ('["2019-01-01", infinity]'),
      ('["2019-02-02", infinity)');
  
  table dt_overlap;
   id │       validity
  ────┼───────────────────────
    1 │ [2019-01-01,infinity)
    2 │ [2019-02-02,infinity)
  
  select id,
      upper(validity),
      upper_inf(validity),
      not isfinite(upper(validity)) as is_inf
  from dt_overlap;
  
   id │  upper   │ upper_inf │ is_inf
  ────┼──────────┼───────────┼────────
    1 │ infinity │ f         │ t
    2 │ infinity │ f         │ t
  </code></pre>
  
  <p>That both values give the same results is kind of expected, since the inclusive upper bound <code>infinity]</code> was coerced to an exclusive upper bound <code>infinity)</code>.</p>
  
  <p>The same problem does not exist for the lower end of the range since the daterange keeps an inclusive lower bound and thus <code>lower_inf()</code> returns <code>true</code>.</p>
  
  <p>Tested and reproduced with Postgresql 9.6.5 and Postgresql 10.3.</p>
  
  <p>Any ideas?</p>