Book Contents

Book Index

Next Topic

Home

Set the Default Time Zone

Make sure that the Linux environment variable TZ is set to the desired value on all cluster hosts. Typically, the TZ variable is the same on all cluster hosts but this is not required; you can configure a cluster to provide convenient client connections from multiple time zones as explained below.

+ START OF SHARED SECTION

When a client receives the result set of an SQL query, all rows contain data adjusted, if necessary, to the same time zone. That time zone is the default time zone of the initiator node unless the client explicitly overrides it using the SQL SET TIMEZONE command (described in the SQL Reference Manual). The default time zone of any node is controlled by the TZ environment variable or, if TZ is undefined, the operating system time zone.

Configuring Multiple Time Zones

As a convenience to clients in multiple time zones, you can designate specific nodes as having specific default time zones. This allows a client to connect to a specific node and execute SQL statements using the default SQL time zone. In other words, there is no need for the client to use the SQL SET TIMEZONE command.

If you do this, however, be aware that:

Setting the Time Zone on a Host

This can be done several different ways and depends on the Linux distribution and/or the system administrators' preferences.

The following time zone names are recognized by Vertica as valid settings for the SQL time zone (the TIMEZONE run-time parameter).

The names listed here are for convenience only and may be out of date. Refer to the Sources for Time Zone and Daylight Saving Time Data page for precise information.

These names are not the same as the names shown in Time Zone Abbreviations For Input, which are recognized by Vertica in date/time input values. The TIMEZONE names shown below imply a local daylight-savings time rule, where date/time input names represent a fixed offset from UTC.

In many cases there are several equivalent names for the same zone. These are listed on the same line. The table is primarily sorted by the name of the principal city of the zone.

 

Time Zone

Africa

America

Antartica

Asia

Atlantic

Australia

CET

EET

Etc/GMT

Europe

Factory

GMT GMT+0 GMT-0 GMT0 Greenwich Etc/GMT Etc/GMT+0 Etc/GMT-0 Etc/GMT0 Etc/Greenwich

Indian

MET

Pacific

UCT Etc/UCT

UTC Universal Zulu Etc/UTC Etc/Universal Etc/Zulu

WET

In addition to the names listed in the table, Vertica will accept time zone names of the form STDoffset or STDoffsetDST, where STD is a zone abbreviation, offset is a numeric offset in hours west from UTC, and DST is an optional daylight-savings zone abbreviation, assumed to stand for one hour ahead of the given offset. For example, if EST5EDT were not already a recognized zone name, it would be accepted and would be functionally equivalent to USA East Coast time. When a daylight-savings zone name is present, it is assumed to be used according to USA time zone rules, so this feature is of limited use outside North America. One should also be wary that this provision can lead to silently accepting bogus input, since there is no check on the reasonableness of the zone abbreviations. For example, SET TIMEZONE TO FOOBAR0 will work, leaving the system effectively using a rather peculiar abbreviation for GMT.