Alex Mayrhofer <axelm@xxxxxxxx> writes: > i'm trying to convert time stamps to "seconds since epoch" and back. > test=# SELECT (TIMESTAMP WITH TIME ZONE 'epoch' > + 0 * INTERVAL '1 second') AT TIME ZONE 'UTC'; You're overthinking the problem. It should be just SELECT (TIMESTAMP WITH TIME ZONE 'epoch' + n * INTERVAL '1 second') There is a built-in function to_timestamp() equivalent to this in 8.1, though it doesn't seem to have made it into the documentation :-( regards, tom lane