title: Postgres query runs on Windows but not Linux
body: <pre><code>SELECT a.*, b.* 
  FROM readings a 
    left join lateral (
       select distinct on (meterno) o.* 
       from offsets o 
       where a.datetime &gt; o.timedate 
       order by o.meterno, o.timedate desc
    ) b ON a.MeterNum = b.MeterNo 
  WHERE a.meternum = 3 
    AND a.LynxKey = 8 
  ORDER BY a.DateTime DESC
  </code></pre>
  <p>This query runs on PostgreSQL 11.11 on Windows, but fails on PostgreSQL 9.2.24 running on a Linux web host.  The hosting company is not anxious to upgrade Postgres. Is there a change to the query that could make it run on both versions?</p>