How to change the default timezone in Amazon Redshift?

淺唱寂寞╮ 提交于 2021-02-07 09:17:02

问题


Setting a timestamp column to SYSDATE by default, stores it as UTC. Is it possible to change the timezone so SYSDATE stores dates and times to a different timezone?

So far, I've checked the SET command but I'm not sure if it is possible to use it to change the timezone.


回答1:


Basically, the answer is no. According to the documentation:

TIMESTAMP values are UTC, not local time, in both user tables and Amazon Redshift system tables.

Note Timestamps with time zones are not supported.

If you need the queries to return data in different timezone, you can use the CONVERT_TIMEZONE function, with either constant timezone value (or query parameter), or joining the result to a configuration table which contains the required timezone.



来源:https://stackoverflow.com/questions/36338266/how-to-change-the-default-timezone-in-amazon-redshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!