Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone didn't change. #23460

Open
macrochel opened this issue May 1, 2024 · 5 comments
Open

Timezone didn't change. #23460

macrochel opened this issue May 1, 2024 · 5 comments
Labels
bug Something isn't working cannot-reproduce Unable to reproduce the opener's problem after attempts to replicate database needs-analysis Issue status is unknown and/or not possible to triage with the current info

Comments

@macrochel
Copy link

macrochel commented May 1, 2024

Self-hosted supabase via docker-compose

I changed my time zone via ALTER DATABASE postgres SET timezone TO 'Asia/Qyzylorda';
Now, when I run SQL query from supabase GUI:
SHOW TIMEZONE;
Output:
Asia/Qyzylorda

And
SELECT now();
Output
2024-05-01T17:55:41.330Z

BUT when I try to make SQL query directly to postgres
SHOW TIMEZONE;
Output
Asia/Qyzylorda

SELECT now();
Output
2024-05-01T12:55:41.330Z

@macrochel macrochel added the bug Something isn't working label May 1, 2024
@encima
Copy link
Contributor

encima commented May 2, 2024

This could be due to the changes. As this is a database setting, often you need to either reload the config or reload the connection.
Does the following work?

  • ALTER DATABASE postgres SET timezone TO 'Asia/Qyzylorda';
  • SHOW timezone; (should output to original timezone)
  • Disconnect and reconnect to the database
  • SHOW timezone; (should show 'Asia/Qyzylorda')

If this works then it is expected behaviour. If it does not, let us know what is different!

@encima encima added database needs-analysis Issue status is unknown and/or not possible to triage with the current info labels May 2, 2024
@macrochel
Copy link
Author

Output from SHOW timezone; changes after ALTER DATABASE postgres SET timezone TO 'Asia/Qyzylorda'; instantly without reconnect or the config reload

@encima
Copy link
Contributor

encima commented May 2, 2024

You will need to start a new session for the config to take place. This is not a bug I am afraid

@macrochel
Copy link
Author

Starting a new session didn't solve the problem, DB still return time by the old timezone.

@encima
Copy link
Contributor

encima commented May 2, 2024

Sorry to hear that, I am afraid debugging further is hard! I cannot reproduce this on hosted or self-hosted. Potentially someone else might have other ideas!

@encima encima added the cannot-reproduce Unable to reproduce the opener's problem after attempts to replicate label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cannot-reproduce Unable to reproduce the opener's problem after attempts to replicate database needs-analysis Issue status is unknown and/or not possible to triage with the current info
Projects
None yet
Development

No branches or pull requests

2 participants