Skip to content

Add session time zone to system context #6786

@mrotteveel

Description

@mrotteveel

Currently it is not possible to obtain the current session time zone other than through workarounds like substring(current_timestamp from 26).

I think we should add:

  • RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE')
  • MON$TIME_ZONE in MON$ATTACHMENTS

Both should return the current session time zone (either named zone or offset in {+|-}HH:MM).

This would be similar to what is provided for the session idle timeout, which is accessible from the system context using RDB$GET_CONTEXT('SYSTEM', 'SESSION_IDLE_TIMEOUT') and from MON$IDLE_TIMEOUT in MON$ATTACHMENTS.

Desired situation:

set time zone 'America/New_York';
select RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE') from rdb$database;
-- returns 'America/New_York'
select MON$TIME_ZONE from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION;
-- returns 'America/New_York'

and

set time zone '+01:00';
select RDB$GET_CONTEXT('SYSTEM', 'SESSION_TIME_ZONE') from rdb$database;
-- returns '+01:00'
select MON$TIME_ZONE from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION;
-- returns '+01:00'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions