title: PostgreSQL filter entries by date but include missed ones with null date
body: <p>Let's say that i have a simple table such as:</p>
  
  <pre><code>CREATE TABLE public.test
  (
      id integer NOT NULL,
      d date NOT NULL
  )
  </code></pre>
  
  <p>with data:</p>
  
  <pre><code>insert into test values(1, '2018-09-05'::date);
  insert into test values(2, '2018-08-05'::date);
  insert into test values(2, '2018-07-05'::date);
  </code></pre>
  
  <p>How could i, in a simplest way possible, get both entries with date being <strong>null</strong> for the record that doesn't meet date filter?
  E.G.</p>
  
  <pre><code>select id, d from
  test where d &gt; '2018-09-01'
  union
  select id, d from test;
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code> 2  "2018-07-05"
   2  "2018-08-05"
   1  "2018-09-05"
  </code></pre>
  
  <p>and i would like:</p>
  
  <pre><code>2   "null"
  1   "2018-09-05"
  </code></pre>
  
  <p>Can't use distinct across union, not that it would help.
  I should maybe join this table to itself and do something but i am not sure what.</p>