Options

TIMESTAMP query depending on vertica server location

Hi

We have a table storing a raw TIMESTAMP value (without any extra timezone information. We would like to query that column assuming UTC timestamp and returning it at UTC. When performing such a query vertica applies a number of implicit conversions, I believe based on the location of the server which in our case is running at 'Europe/London'. We managed to construct a query that returns what we want but it seems a bit clunky:

select ts at time zone 'Europe/London' at time zone 'UTC' as ts from MyTable where ts > '2019-04-24 11:00:07.353 UTC' and ts < '2019-04-24 11:00:07.477 UTC';

Is there a way to avoid double timestamp conversion? If not, is there at least a way to embed server timezone in the query itself rather than hardcoding 'Europe/London'?

Thank you

Tagged:

Best Answer

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file