timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.9k stars 882 forks source link

[Bug]: The timezone is incorrect. #7179

Closed naddang closed 3 months ago

naddang commented 3 months ago

What type of bug is this?

Incorrect result

What subsystems and features are affected?

Query executor

What happened?

hello. I'm using a translator, so the vocabulary may be a bit sloppy. Please be patient. I am developing in conjunction with Java Springboot. When querying through PgAdmin4, the default timezone is displayed as the default value (Asia/Seoul) set when running the docker container, but when querying using MyBatis, the timezone is displayed as GMT-09:00. If I run the set timezone query before running the query or before running the project, it works fine, but this is not what I was hoping for. Is there any way to work around this issue? Thank you.

summary: if i querying

SELECT current_setting('timezone');

pgAdmin4 -> Asia/Seoul In Java -> GMT-09:00

TimescaleDB version affected

2.15.0

PostgreSQL version used

16.2

What operating system did you use?

jvm = windows11, postgres = postgres16.2 docker image

What installation method did you use?

Docker

What platform did you run on?

Other

Relevant log output and stack trace

No response

How can we reproduce the bug?

SELECT current_setting('timezone');
jonatas commented 3 months ago

Hi @naddang , this is a problem in the postgresql session that is inheriting an undesired time zone. It will depend on the client running on your computer. You should configure it to match and you can also reinforce a different time zone. By default, the client inherits your OS configuration.

Just try the same with a docker image based on Postgres and you'll see it will have the same behavior.