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

Handle exception when timezone is `localtime` #2264

Merged
merged 1 commit into from Dec 22, 2018

Conversation

Projects
None yet
3 participants
@austindrenski
Copy link
Member

austindrenski commented Dec 16, 2018

Finally got around to following up on npgsql/Npgsql.EntityFrameworkCore.PostgreSQL#578.

@austindrenski austindrenski added this to the 4.1 milestone Dec 16, 2018

@austindrenski austindrenski self-assigned this Dec 16, 2018

@austindrenski austindrenski requested review from roji and YohDeadfall as code owners Dec 16, 2018

Handle exception when timezone is `localtime`
The configuration property `timezone` in `postgresql.conf` can be
set to a special value of `localtime` to indicate that PosgreSQL
should use the timezone of the host system.

Unfortunately, when this value is set, we do not have sufficient
information to determine the actual timezone of the server because
`SHOW timezone` itself returns `localtime`.

This value is not well-documented, but is also unlikely to be
encountered very often, so we identify the exception and construct
a new `DateTimeZoneNotFoundException` with a more informative
message that includes mitigations that can be applied on either
the server or the client.

See: npgsql/Npgsql.EntityFrameworkCore.PostgreSQL#578

@austindrenski austindrenski force-pushed the austindrenski:timezone-localtime branch from 673c531 to 50a50e3 Dec 17, 2018

@austindrenski

This comment has been minimized.

Copy link
Member

austindrenski commented Dec 17, 2018

Just saw nodatime/nodatime#1132. Updated to catch TimeZoneNotFoundException which is the base class of DateTimeZoneNotFoundException.

@austindrenski austindrenski modified the milestones: 4.1, 4.0.5 Dec 17, 2018

@roji

roji approved these changes Dec 21, 2018

@austindrenski austindrenski merged commit 140c1b4 into npgsql:dev Dec 22, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@austindrenski austindrenski deleted the austindrenski:timezone-localtime branch Dec 22, 2018

austindrenski added a commit that referenced this pull request Dec 22, 2018

Handle exception when timezone is `localtime` (#2264)
The configuration property `timezone` in `postgresql.conf` can be
set to a special value of `localtime` to indicate that PosgreSQL
should use the timezone of the host system.

Unfortunately, when this value is set, we do not have sufficient
information to determine the actual timezone of the server because
`SHOW timezone` itself returns `localtime`.

This value is not well-documented, but is also unlikely to be
encountered very often, so we identify the exception and construct
a new `TimeZoneNotFoundException` with a more informative
message that includes mitigations that can be applied on either
the server or the client.

See: npgsql/Npgsql.EntityFrameworkCore.PostgreSQL#578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment