title: in sql, how to choose random time in from records having from and thru timestamp
body: <p>have records, each having</p>
  
  <pre><code>pk_id  serial primary key,
  key varchar(20),
  ...
  from_ts timestamp(0) not null,
  thru_ts timestamp(0) not null,
  </code></pre>
  
  <p>wish to choose random time from intervals as determined by <code>from_ts</code> to <code>thru_ts</code></p>
  
  <p>a record with a two hour interval should have twice as much chance of being selected as a record with a one hour interval.</p>
  
  <p>records having the same key are disjoint - there are no overlapping times</p>
  
  <p>wish to select the <code>pk_id</code> and the random timestamp.</p>
  
  <pre><code>select pk_id, ???
  from rcds
  where key = 'abc'
  </code></pre>
  
  <p>using <code>postgres</code>, so ANSI plus <code>interval</code> datatype</p>