How do I compare a time difference with a number of seconds in Postgres?
<p>I want to create a condition for expiration in Postgres. I've got a vartiable <code>last_sync::timestamp</code> and a limit <code>86400 * 30</code> seconds. I tried this way:</p>

<pre><code>NOW() - last_sync &gt; 86400 * 30
</code></pre>

<p>But it gives an error: no operator for interval > integer.</p>

<p>I would like to make it work even if <code>last_sunc</code> is <code>-infinity</code>.</p>

<p>How can I do this comparison correctly?</p>