如何在Amazon Redshift中更改默认时区? [英] How to change the default timezone in Amazon Redshift?

查看:82
本文介绍了如何在Amazon Redshift中更改默认时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认将时间戳列设置为SYSDATE,并将其存储为 UTC .是否可以更改时区,以便SYSDATE将日期和时间存储到其他时区?

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?

到目前为止,我已经检查了 SET 命令但我不确定是否可以使用它来更改时区.

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

推荐答案

基本上,答案是否定的.根据文档:

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

在用户表和Amazon Redshift系统表.

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.

这篇关于如何在Amazon Redshift中更改默认时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆