"Lane Van Ingen" <lvaningen@esncc.com> writes:
> My code says:
> select date_trunc('seconds',localtimestamp)::timestamp -
> neighbor_seconds::integer;
> ERROR: operator does not exist: timestamp without time zone - integer
Right. What you need is to use the operators that are there, which
are timestamp minus interval and number times interval:
select date_trunc('seconds',localtimestamp) - neighbor_seconds * '1 second'::interval;
The two casts you did write are both pointless, as the given values were
already of those datatypes.
regards, tom lane