greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

PG's timezone set syntax is different from other variables

Open killme2008 opened this issue 1 year ago • 2 comments

I just realized PG's timezone is different from other variables: https://www.postgresql.org/docs/current/sql-set.html

SET TIME ZONE '+08:00';
SET TIME ZONE 'Asia/Shanghai';

Maybe we need another PR to align this behavior

Originally posted by @waynexia in https://github.com/GreptimeTeam/greptimedb/pull/3175#discussion_r1460310841

killme2008 avatar Jan 20 '24 14:01 killme2008

kind of go through this issue, I think maybe the better way is update the sqlparser fork (maybe cherry-pick) for now sqlparser support Statement::SetTimeZone its kind of simple way to support both MySQL and PG.

refer: https://github.com/sqlparser-rs/sqlparser-rs/pull/727/files

yihong0618 avatar Mar 08 '24 10:03 yihong0618

kind of go through this issue, I think maybe the better way is update the sqlparser fork (maybe cherry-pick) for now sqlparser support Statement::SetTimeZone its kind of simple way to support both MySQL and PG.

refer: https://github.com/sqlparser-rs/sqlparser-rs/pull/727/files

Thanks for your information 👍 @Taylor-lagrange has just updated the branch to v0.44.0 compatible https://github.com/GreptimeTeam/sqlparser-rs/tree/v0.44.x. I'm going to bump it with datafusion recently.

waynexia avatar Mar 08 '24 11:03 waynexia