Larry Lennhoff <[EMAIL PROTECTED]> writes:
> What I want to do is find all the rows in 
> A which were built before now() - build_interval seconds ago.  If I could 
> just write this in SQL it would look something like:

> SELECT A.id FROM A JOIN B ON (join_col) WHERE built_on < now() - interval 
> 'build_interval seconds';

You are confused about the difference between a literal constant and an
expression.   Try something like

... WHERE built_on < now() - build_interval * interval '1 second';

which relies on the number-times-interval operator.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to