Skip to content

Hide timezone notice when local and server timezones are the same#1580

Open
dbaty wants to merge 1 commit intomainfrom
dbaty/hide_timezone_notice
Open

Hide timezone notice when local and server timezones are the same#1580
dbaty wants to merge 1 commit intomainfrom
dbaty/hide_timezone_notice

Conversation

@dbaty
Copy link
Copy Markdown
Member

@dbaty dbaty commented Apr 23, 2026

Description

This takes space and is not very useful.

Now the notice is only printed when the local timezone is different from the server timezone, for example:

Using local time zone Europe/Paris (server uses Etc/UTC)
Use `set time zone <TZ>` to override, or set `use_local_timezone = False` in the config

Fixes #1579.

Demo

When local and server timezones are different:

$ pgcli
Using local time zone Europe/Paris (server uses Etc/UTC)
Use `set time zone <TZ>` to override, or set `use_local_timezone = False` in the config
Server: PostgreSQL 17.5 (Debian 17.5-1.pgdg110+1)
[...]

When timezones are the same:

$ pgcli
Server: PostgreSQL 17.5 (Debian 17.5-1.pgdg110+1)
[...]

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install).
  • I verified that my changes work as expected (this may include manually testing them in your local environment, or in other available environments). Cross this out if not relevant (for example, if you're making a documentation change).
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

This takes space and is not very useful.

Now the notice is only printed when the local timezone is different
from the server timezone, for example:

    Using local time zone Europe/Paris (server uses Etc/UTC)
    Use `set time zone <TZ>` to override, or set `use_local_timezone = False` in the config

Fixes #1579.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip time zone warning when local and server are the same

1 participant