天道酬勤,学无止境

razorsql

红移 convert_timezone 不起作用(redshift convert_timezone does not work)

问题 使用 Razor SQL 运行 Redshift 查询时,UTC 日期似乎被视为在本地时区中,包括夏令时。 例如,运行 SELECT 'first',CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-27 06:00:00') UNION SELECT 'second', CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-27 07:00:00') 每个返回时间相同,2016-03-27 03:00 纽约实际上在 3 月 13 日改为夏令时,这确实有效: SELECT 'first',CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-13 06:00:00') UNION SELECT 'second', CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-13 07:00:00') 回答1 所以这被证明是亚马逊 redshift JDBCS 驱动程序中的一个错误。 如果您在标准 postgres JDBC 驱动程序中运行相同的查询,它就可以正常工作。 我还没有收到亚马逊关于可能修复的任何反馈。

2021-10-15 01:14:04    分类:技术分享    amazon-redshift   razorsql

redshift convert_timezone does not work

When running Redshift queries using Razor SQL, UTC dates appear to be treated as being in the local timezone, complete with daylight saving times. For example, running SELECT 'first',CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-27 06:00:00') UNION SELECT 'second', CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-27 07:00:00') returns the same time for each, 2016-03-27 03:00 New York actually changed to daylight saving time on the 13th March and this does work: SELECT 'first',CONVERT_TIMEZONE('UTC', 'America/New_York', '2016-03-13 06:00:00') UNION SELECT 'second', CONVERT_TIMEZONE(

2021-10-12 01:37:03    分类:问答    amazon-redshift   razorsql

PostgreSQL通过SSH隧道(PostgreSQL via SSH Tunnel)

问题 我想使用RazorSQL连接到在远程服务器上运行的数据库。 我使用以下命令在本地主机上创建SSH隧道: ssh -L 1111:remote.server.com:5432 myuser@remote.server.com 我通过RazorSQL的GUI配置连接,将localhost指定为主机,将1111指定为端口。 当我单击“连接”时,出现以下错误消息: ERROR: An error occurred while trying to make a connection to the database: JDBC URL: jdbc:postgresql://localhost:1111/myuser FATAL: no pg_hba.conf entry for host "aaa.bbb.ccc.ddd", user "myuser", database "mydatabase", SSL off 其中aaa.bbb.ccc.ddd是远程服务器的IP地址。 而且,我不允许更改pg_hba.conf文件的内容。 目前是这样的: # TYPE DATABASE USER CIDR-ADDRESS METHOD @remove-line-for-nolocal@# "local" is for Unix domain socket connections only

2021-04-27 09:40:36    分类:技术分享    postgresql   ssh   tunnel   razorsql

PostgreSQL via SSH Tunnel

I'd like to use RazorSQL to connect to my database which is running on a remote server. I create a SSH tunnel on my localhost with the following command: ssh -L 1111:remote.server.com:5432 myuser@remote.server.com I configure my connection via RazorSQL's GUI, specifying localhost as the host and 1111 as the port. When I click on "Connect", the following error message appears: ERROR: An error occurred while trying to make a connection to the database: JDBC URL: jdbc:postgresql://localhost:1111/myuser FATAL: no pg_hba.conf entry for host "aaa.bbb.ccc.ddd", user "myuser", database "mydatabase"

2021-04-03 21:54:41    分类:问答    postgresql   ssh   tunnel   razorsql