Roman Neuhauser <neuhauser(at)chello(dot)cz> writes:
> what is the opposite of cast(extract('epoch' from now()) as int)?
> The only thing I found that works is
> cast(cast(... as abstime) as timestamp)
> and the documentation says abstime shouldn't be used, and may
> disappear. What should I use instead?
The recommended locution is
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + <x> * INTERVAL '1 second';
Of course you can wrap this up in a function if you prefer (not sure why
we haven't done so already).
regards, tom lane