From 97b1ac1aefb3c63308aeca1654121964b2501f41 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 10 Aug 2004 00:55:08 +0000 Subject: [PATCH] Update documentation to reflect the fact that we now know exactly what time zone names we support. --- doc/src/sgml/datatype.sgml | 120 ++-- doc/src/sgml/datetime.sgml | 1311 +++++++++++++++++++++++++++++++++++- doc/src/sgml/func.sgml | 40 +- doc/src/sgml/ref/set.sgml | 28 +- 4 files changed, 1378 insertions(+), 121 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index fdc63d8250..c35ef9edb4 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,5 +1,5 @@ @@ -1668,6 +1668,11 @@ SELECT b, char_length(b) FROM test2; + + + Refer to for a list of + time zone names that are recognized for input. + @@ -1687,9 +1692,11 @@ SELECT b, char_length(b) FROM test2; Valid input for the time stamp types consists of a concatenation - of a date and a time, followed by an optional - AD or BC, followed by an - optional time zone. Thus + of a date and a time, followed by an optional time zone, + followed by an optional AD or BC. + (Alternatively, AD/BC can appear + before the time zone, but this is not the preferred ordering.) + Thus 1999-01-08 04:05:06 @@ -1798,17 +1805,7 @@ January 8 04:05:06 1999 PST - The following SQL-compatible functions can be - used as date or time values for the corresponding data type: - CURRENT_DATE, CURRENT_TIME, - CURRENT_TIMESTAMP, LOCALTIME, - LOCALTIMESTAMP. The latter four accept an - optional precision specification. (See also .) - - - - PostgreSQL also supports several + PostgreSQL supports several special date/time input values for convenience, as shown in . The values infinity and -infinity @@ -1874,6 +1871,18 @@ January 8 04:05:06 1999 PST + + The following SQL-compatible functions can also + be used to obtain the current time value for the corresponding data + type: + CURRENT_DATE, CURRENT_TIME, + CURRENT_TIMESTAMP, LOCALTIME, + LOCALTIMESTAMP. The latter four accept an + optional precision specification. (See also .) Note however that these are + SQL functions and are not recognized as data input strings. + + @@ -1985,12 +1994,12 @@ January 8 04:05:06 1999 PST interval output looks like the input format, except that units like century or - wek are converted to years and days and that + week are converted to years and days and ago is converted to an appropriate sign. In ISO mode the output looks like - quantity unit ... days hours:minutes:sekunden + quantity unit ... days hours:minutes:seconds @@ -2017,19 +2026,13 @@ January 8 04:05:06 1999 PST Time zones, and time-zone conventions, are influenced by political decisions, not just earth geometry. Time zones around the world became somewhat standardized during the 1900's, - but continue to be prone to arbitrary changes. - PostgreSQL uses your operating - system's underlying features to provide output time-zone - support, and these systems usually contain information for only - the time period 1902 through 2038 (corresponding to the full - range of conventional Unix system time). - timestamp with time zone and time with time - zone will use time zone - information only within that year range, and assume that times - outside that range are in UTC. - But since time zone support is derived from the underlying operating - system time-zone capabilities, it can handle daylight-saving time - and other special behavior. + but continue to be prone to arbitrary changes, particularly with + respect to daylight-savings rules. + PostgreSQL currently supports daylight-savings + rules over the time period 1902 through 2038 (corresponding to the full + range of conventional Unix system time). Times outside that range are + taken to be in standard time for the selected time zone, no + matter what part of the year they fall in. @@ -2044,8 +2047,8 @@ January 8 04:05:06 1999 PST Although the date type does not have an associated time zone, the time type can. - Time zones in the real world can have no meaning unless - associated with a date as well as a time + Time zones in the real world have little meaning unless + associated with a date as well as a time, since the offset may vary through the year with daylight-saving time boundaries. @@ -2054,8 +2057,8 @@ January 8 04:05:06 1999 PST The default time zone is specified as a constant numeric offset - from UTC. It is not possible to adapt to daylight-saving - time when doing date/time arithmetic across + from UTC. It is therefore not possible to adapt to + daylight-saving time when doing date/time arithmetic across DST boundaries. @@ -2069,34 +2072,45 @@ January 8 04:05:06 1999 PST recommend not using the type time with time zone (though it is supported by PostgreSQL for legacy applications and - for compatibility with other SQL - implementations). PostgreSQL assumes + for compliance with the SQL standard). + PostgreSQL assumes your local time zone for any type containing only date or time. - All dates and times are stored internally in - UTC. Times are converted to local time - on the database server before being sent to the client, - hence by default are in the server time zone. + All timezone-aware dates and times are stored internally in + UTC. They are converted to local time + in the zone specified by the configuration + parameter before being displayed to the client. - There are several ways to select the time zone used by the server: + The configuration parameter can + be set in the file postgresql.conf, or in any of the + other standard ways described in . + There are also several special ways to set it: - The TZ environment variable on the server host - is used by the server as the default time zone, if no other is - specified. + If timezone is not specified in + postgresql.conf nor as a postmaster command-line switch, + the server attempts to use the value of the TZ + environment variable as the default time zone. If TZ + is not defined or is not any of the time zone names known to + PostgreSQL, the server attempts to + determine the operating system's default time zone by checking the + behavior of the C library function localtime(). The + default time zone is selected as the closest match among + PostgreSQL's known time zones. - The configuration parameter can - be set in the file postgresql.conf. + The SQL command SET TIME ZONE + sets the time zone for the session. This is an alternative spelling + of SET TIMEZONE TO with a more SQL-spec-compatible syntax. @@ -2108,23 +2122,9 @@ January 8 04:05:06 1999 PST command to the server upon connection. - - - - The SQL command SET TIME ZONE - sets the time zone for the session. - - - - - If an invalid time zone is specified, the time zone becomes - UTC (on most systems anyway). - - - Refer to for a list of available time zones. diff --git a/doc/src/sgml/datetime.sgml b/doc/src/sgml/datetime.sgml index dd5d371e19..e037cf9718 100644 --- a/doc/src/sgml/datetime.sgml +++ b/doc/src/sgml/datetime.sgml @@ -1,5 +1,5 @@ @@ -13,8 +13,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian field. Each field is interpreted and either assigned a numeric value, ignored, or rejected. The parser contains internal lookup tables for all textual fields, - including months, days of the week, and time - zones. + including months, days of the week, and time zones. @@ -161,16 +160,15 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian If BC has been specified, negate the year and add one for internal storage. (There is no year zero in the Gregorian - calendar, so numerically 1 BC becomes year - zero.) + calendar, so numerically 1 BC becomes year zero.) - If BC was not specified, and if the year field was two digits in length, then - adjust the year to four digits. If the field is less than 70, then add 2000, - otherwise add 1900. + If BC was not specified, and if the year field was two digits in length, + then adjust the year to four digits. If the field is less than 70, then + add 2000, otherwise add 1900. @@ -365,28 +363,17 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian time zone - abbreviations + input abbreviations - shows the time zone + shows the time zone abbreviations recognized by PostgreSQL - in date/time input values. - PostgreSQL uses internal tables - for time zone input decoding, since there is no standard - operating system interface to provide access to general, - cross-time zone information. The underlying operating system - is used to provide time zone information for - output, however. - - - - Keep in mind also that the time zone names - recognized by SET TIMEZONE are operating-system - dependent and may have little to do with . For example, some systems - recognize values like 'Europe/Rome' in SET - TIMEZONE. + in date/time input values. Note that these names are not + used for date/time output --- display is driven by the currently + selected parameter setting. (It is + likely that future releases will make some use of timezone + for input as well.) @@ -396,8 +383,8 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian these might differ. - - Time Zone Abbreviations +
+ Time Zone Abbreviations for Input @@ -963,7 +950,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian
- Australian Time Zone Abbreviations + Australian Time Zone Abbreviations for Input @@ -997,6 +984,1272 @@ $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.41 2004/03/31 16:20:53 momjian
+ + time zone + configuration names + + + + shows the time zone + names recognized by PostgreSQL as valid + settings for the parameter. Note that + these names are conceptually as well as practically different from + the names shown in : + most of these names imply a local daylight-savings time rule, whereas + the former names each represent just 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 Names for Setting <varname>timezone</> + + + + Time Zone + + + + + Africa/Abidjan + + + Africa/Accra + + + Africa/Addis_Ababa + + + Africa/Algiers + + + Africa/Asmera + + + Africa/Bamako + + + Africa/Bangui + + + Africa/Banjul + + + Africa/Bissau + + + Africa/Blantyre + + + Africa/Brazzaville + + + Africa/Bujumbura + + + Africa/Cairo Egypt + + + Africa/Casablanca + + + Africa/Ceuta + + + Africa/Conakry + + + Africa/Dakar + + + Africa/Dar_es_Salaam + + + Africa/Djibouti + + + Africa/Douala + + + Africa/El_Aaiun + + + Africa/Freetown + + + Africa/Gaborone + + + Africa/Harare + + + Africa/Johannesburg + + + Africa/Kampala + + + Africa/Khartoum + + + Africa/Kigali + + + Africa/Kinshasa + + + Africa/Lagos + + + Africa/Libreville + + + Africa/Lome + + + Africa/Luanda + + + Africa/Lubumbashi + + + Africa/Lusaka + + + Africa/Malabo + + + Africa/Maputo + + + Africa/Maseru + + + Africa/Mbabane + + + Africa/Mogadishu + + + Africa/Monrovia + + + Africa/Nairobi + + + Africa/Ndjamena + + + Africa/Niamey + + + Africa/Nouakchott + + + Africa/Ouagadougou + + + Africa/Porto-Novo + + + Africa/Sao_Tome + + + Africa/Timbuktu + + + Africa/Tripoli Libya + + + Africa/Tunis + + + Africa/Windhoek + + + America/Adak America/Atka US/Aleutian + + + America/Anchorage SystemV/YST9YDT US/Alaska + + + America/Anguilla + + + America/Antigua + + + America/Araguaina + + + America/Aruba + + + America/Asuncion + + + America/Bahia + + + America/Barbados + + + America/Belem + + + America/Belize + + + America/Boa_Vista + + + America/Bogota + + + America/Boise + + + America/Buenos_Aires + + + America/Cambridge_Bay + + + America/Campo_Grande + + + America/Cancun + + + America/Caracas + + + America/Catamarca + + + America/Cayenne + + + America/Cayman + + + America/Chicago CST6CDT SystemV/CST6CDT US/Central + + + America/Chihuahua + + + America/Cordoba America/Rosario + + + America/Costa_Rica + + + America/Cuiaba + + + America/Curacao + + + America/Danmarkshavn + + + America/Dawson + + + America/Dawson_Creek + + + America/Denver MST7MDT SystemV/MST7MDT US/Mountain America/Shiprock Navajo + + + America/Detroit US/Michigan + + + America/Dominica + + + America/Edmonton Canada/Mountain + + + America/Eirunepe + + + America/El_Salvador + + + America/Ensenada America/Tijuana Mexico/BajaNorte + + + America/Fortaleza + + + America/Glace_Bay + + + America/Godthab + + + America/Goose_Bay + + + America/Grand_Turk + + + America/Grenada + + + America/Guadeloupe + + + America/Guatemala + + + America/Guayaquil + + + America/Guyana + + + America/Halifax Canada/Atlantic SystemV/AST4ADT + + + America/Havana Cuba + + + America/Hermosillo + + + America/Indiana/Indianapolis America/Indianapolis America/Fort_Wayne EST SystemV/EST5 US/East-Indiana + + + America/Indiana/Knox America/Knox_IN US/Indiana-Starke + + + America/Indiana/Marengo + + + America/Indiana/Vevay + + + America/Inuvik + + + America/Iqaluit + + + America/Jamaica Jamaica + + + America/Jujuy + + + America/Juneau + + + America/Kentucky/Louisville America/Louisville + + + America/Kentucky/Monticello + + + America/La_Paz + + + America/Lima + + + America/Los_Angeles PST8PDT SystemV/PST8PDT US/Pacific US/Pacific-New + + + America/Maceio + + + America/Managua + + + America/Manaus Brazil/West + + + America/Martinique + + + America/Mazatlan Mexico/BajaSur + + + America/Mendoza + + + America/Menominee + + + America/Merida + + + America/Mexico_City Mexico/General + + + America/Miquelon + + + America/Monterrey + + + America/Montevideo + + + America/Montreal + + + America/Montserrat + + + America/Nassau + + + America/New_York EST5EDT SystemV/EST5EDT US/Eastern + + + America/Nipigon + + + America/Nome + + + America/Noronha Brazil/DeNoronha + + + America/North_Dakota/Center + + + America/Panama + + + America/Pangnirtung + + + America/Paramaribo + + + America/Phoenix MST SystemV/MST7 US/Arizona + + + America/Port-au-Prince + + + America/Port_of_Spain + + + America/Porto_Acre America/Rio_Branco Brazil/Acre + + + America/Porto_Velho + + + America/Puerto_Rico SystemV/AST4 + + + America/Rainy_River + + + America/Rankin_Inlet + + + America/Recife + + + America/Regina Canada/East-Saskatchewan Canada/Saskatchewan SystemV/CST6 + + + America/Santiago Chile/Continental + + + America/Santo_Domingo + + + America/Sao_Paulo Brazil/East + + + America/Scoresbysund + + + America/St_Johns Canada/Newfoundland + + + America/St_Kitts + + + America/St_Lucia + + + America/St_Thomas America/Virgin + + + America/St_Vincent + + + America/Swift_Current + + + America/Tegucigalpa + + + America/Thule + + + America/Thunder_Bay + + + America/Toronto Canada/Eastern + + + America/Tortola + + + America/Vancouver Canada/Pacific + + + America/Whitehorse Canada/Yukon + + + America/Winnipeg Canada/Central + + + America/Yakutat + + + America/Yellowknife + + + Antarctica/Casey + + + Antarctica/Davis + + + Antarctica/DumontDUrville + + + Antarctica/Mawson + + + Antarctica/McMurdo Antarctica/South_Pole + + + Antarctica/Palmer + + + Antarctica/Rothera + + + Antarctica/Syowa + + + Antarctica/Vostok + + + Asia/Aden + + + Asia/Almaty + + + Asia/Amman + + + Asia/Anadyr + + + Asia/Aqtau + + + Asia/Aqtobe + + + Asia/Ashgabat Asia/Ashkhabad + + + Asia/Baghdad + + + Asia/Bahrain + + + Asia/Baku + + + Asia/Bangkok + + + Asia/Beirut + + + Asia/Bishkek + + + Asia/Brunei + + + Asia/Calcutta + + + Asia/Choibalsan + + + Asia/Chongqing Asia/Chungking + + + Asia/Colombo + + + Asia/Dacca Asia/Dhaka + + + Asia/Damascus + + + Asia/Dili + + + Asia/Dubai + + + Asia/Dushanbe + + + Asia/Gaza + + + Asia/Harbin + + + Asia/Hong_Kong Hongkong + + + Asia/Hovd + + + Asia/Irkutsk + + + Asia/Jakarta + + + Asia/Jayapura + + + Asia/Jerusalem Asia/Tel_Aviv Israel + + + Asia/Kabul + + + Asia/Kamchatka + + + Asia/Karachi + + + Asia/Kashgar + + + Asia/Katmandu + + + Asia/Krasnoyarsk + + + Asia/Kuala_Lumpur + + + Asia/Kuching + + + Asia/Kuwait + + + Asia/Macao Asia/Macau + + + Asia/Magadan + + + Asia/Makassar Asia/Ujung_Pandang + + + Asia/Manila + + + Asia/Muscat + + + Asia/Nicosia Europe/Nicosia + + + Asia/Novosibirsk + + + Asia/Omsk + + + Asia/Oral + + + Asia/Phnom_Penh + + + Asia/Pontianak + + + Asia/Pyongyang + + + Asia/Qatar + + + Asia/Qyzylorda + + + Asia/Rangoon + + + Asia/Riyadh + + + Asia/Riyadh87 Mideast/Riyadh87 + + + Asia/Riyadh88 Mideast/Riyadh88 + + + Asia/Riyadh89 Mideast/Riyadh89 + + + Asia/Saigon + + + Asia/Sakhalin + + + Asia/Samarkand + + + Asia/Seoul ROK + + + Asia/Shanghai PRC + + + Asia/Singapore Singapore + + + Asia/Taipei ROC + + + Asia/Tashkent + + + Asia/Tbilisi + + + Asia/Tehran Iran + + + Asia/Thimbu Asia/Thimphu + + + Asia/Tokyo Japan + + + Asia/Ulaanbaatar Asia/Ulan_Bator + + + Asia/Urumqi + + + Asia/Vientiane + + + Asia/Vladivostok + + + Asia/Yakutsk + + + Asia/Yekaterinburg + + + Asia/Yerevan + + + Atlantic/Azores + + + Atlantic/Bermuda + + + Atlantic/Canary + + + Atlantic/Cape_Verde + + + Atlantic/Faeroe + + + Atlantic/Madeira + + + Atlantic/Reykjavik Iceland + + + Atlantic/South_Georgia + + + Atlantic/St_Helena + + + Atlantic/Stanley + + + Australia/ACT Australia/Canberra Australia/NSW Australia/Sydney + + + Australia/Adelaide Australia/South + + + Australia/Brisbane Australia/Queensland + + + Australia/Broken_Hill Australia/Yancowinna + + + Australia/Darwin Australia/North + + + Australia/Hobart Australia/Tasmania + + + Australia/LHI Australia/Lord_Howe + + + Australia/Lindeman + + + Australia/Melbourne Australia/Victoria + + + Australia/Perth Australia/West + + + CET + + + EET + + + Etc/GMT+1 + + + Etc/GMT+2 + + + Etc/GMT+3 + + + Etc/GMT+4 + + + Etc/GMT+5 + + + Etc/GMT+6 + + + Etc/GMT+7 + + + Etc/GMT+8 + + + Etc/GMT+9 + + + Etc/GMT+10 + + + Etc/GMT+11 + + + Etc/GMT+12 + + + Etc/GMT-1 + + + Etc/GMT-2 + + + Etc/GMT-3 + + + Etc/GMT-4 + + + Etc/GMT-5 + + + Etc/GMT-6 + + + Etc/GMT-7 + + + Etc/GMT-8 + + + Etc/GMT-9 + + + Etc/GMT-10 + + + Etc/GMT-11 + + + Etc/GMT-12 + + + Etc/GMT-13 + + + Etc/GMT-14 + + + Europe/Amsterdam + + + Europe/Andorra + + + Europe/Athens + + + Europe/Belfast + + + Europe/Belgrade Europe/Ljubljana Europe/Sarajevo Europe/Skopje Europe/Zagreb + + + Europe/Berlin + + + Europe/Brussels + + + Europe/Bucharest + + + Europe/Budapest + + + Europe/Chisinau Europe/Tiraspol + + + Europe/Copenhagen + + + Europe/Dublin Eire + + + Europe/Gibraltar + + + Europe/Helsinki + + + Europe/Istanbul Asia/Istanbul Turkey + + + Europe/Kaliningrad + + + Europe/Kiev + + + Europe/Lisbon Portugal + + + Europe/London GB GB-Eire + + + Europe/Luxembourg + + + Europe/Madrid + + + Europe/Malta + + + Europe/Minsk + + + Europe/Monaco + + + Europe/Moscow W-SU + + + Europe/Oslo Arctic/Longyearbyen Atlantic/Jan_Mayen + + + Europe/Paris + + + Europe/Prague Europe/Bratislava + + + Europe/Riga + + + Europe/Rome Europe/San_Marino Europe/Vatican + + + Europe/Samara + + + Europe/Simferopol + + + Europe/Sofia + + + Europe/Stockholm + + + Europe/Tallinn + + + Europe/Tirane + + + Europe/Uzhgorod + + + Europe/Vaduz + + + Europe/Vienna + + + Europe/Vilnius + + + Europe/Warsaw Poland + + + Europe/Zaporozhye + + + Europe/Zurich + + + Factory + + + GMT GMT+0 GMT-0 GMT0 Greenwich Etc/GMT Etc/GMT+0 Etc/GMT-0 Etc/GMT0 Etc/Greenwich + + + Indian/Antananarivo + + + Indian/Chagos + + + Indian/Christmas + + + Indian/Cocos + + + Indian/Comoro + + + Indian/Kerguelen + + + Indian/Mahe + + + Indian/Maldives + + + Indian/Mauritius + + + Indian/Mayotte + + + Indian/Reunion + + + MET + + + Pacific/Apia + + + Pacific/Auckland NZ + + + Pacific/Chatham NZ-CHAT + + + Pacific/Easter Chile/EasterIsland + + + Pacific/Efate + + + Pacific/Enderbury + + + Pacific/Fakaofo + + + Pacific/Fiji + + + Pacific/Funafuti + + + Pacific/Galapagos + + + Pacific/Gambier SystemV/YST9 + + + Pacific/Guadalcanal + + + Pacific/Guam + + + Pacific/Honolulu HST SystemV/HST10 US/Hawaii + + + Pacific/Johnston + + + Pacific/Kiritimati + + + Pacific/Kosrae + + + Pacific/Kwajalein Kwajalein + + + Pacific/Majuro + + + Pacific/Marquesas + + + Pacific/Midway + + + Pacific/Nauru + + + Pacific/Niue + + + Pacific/Norfolk + + + Pacific/Noumea + + + Pacific/Pago_Pago Pacific/Samoa US/Samoa + + + Pacific/Palau + + + Pacific/Pitcairn SystemV/PST8 + + + Pacific/Ponape + + + Pacific/Port_Moresby + + + Pacific/Rarotonga + + + Pacific/Saipan + + + Pacific/Tahiti + + + Pacific/Tarawa + + + Pacific/Tongatapu + + + Pacific/Truk + + + Pacific/Wake + + + Pacific/Wallis + + + Pacific/Yap + + + UCT Etc/UCT + + + UTC Universal Zulu Etc/UTC Etc/Universal Etc/Zulu + + + WET + + + +
+ + + In addition to the names listed in the table, + PostgreSQL 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. + + diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2f609f00bf..1c06faac5e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -5027,7 +5027,7 @@ EXTRACT (field FROM source century - The historical definition of a century. + The century @@ -5038,20 +5038,19 @@ SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40'); - An historical century is a period of 100 years. - The first century starts at 0001-01-01 00:00:00 AD, although - they did not know at the time. This definition applies to all - Gregorian calendar countries. There is no number 0 century, - you go from -1 to 1. + The first century starts at 0001-01-01 00:00:00 AD, although + they did not know it at the time. This definition applies to all + Gregorian calendar countries. There is no century number 0, + you go from -1 to 1. - If you disagree with this, please write your complaint to: - Pope, Cathedral Saint-Peter of Roma, Vatican. + If you disagree with this, please write your complaint to: + Pope, Cathedral Saint-Peter of Roma, Vatican. - Compatibility: if you want the previous postgres version of century, - just divide the year by 100. Note that with this definition, - century number 0 lasts 200 years. + PostgreSQL releases before 8.0 did not + follow the conventional numbering of centuries, but just returned + the year field divided by 100. @@ -5175,7 +5174,7 @@ SELECT EXTRACT(MICROSECONDS FROM TIME '17:12:28.5'); millennium - The conventional historical millennium. + The millennium @@ -5184,8 +5183,14 @@ SELECT EXTRACT(MILLENNIUM FROM TIMESTAMP '2001-02-16 20:38:40'); - Years in the 1900's are in the second millennium. - The third millennium starts January 1, 2001. + Years in the 1900s are in the second millennium. + The third millennium starts January 1, 2001. + + + + PostgreSQL releases before 8.0 did not + follow the conventional numbering of millennia, but just returned + the year field divided by 1000. @@ -5481,6 +5486,11 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40'); In these expressions, the desired time zone zone can be specified either as a text string (e.g., 'PST') or as an interval (e.g., INTERVAL '-08:00'). + In the text case, the available zone names are those shown in + . (It would be useful + to support the more general names shown in + , but this is not yet + implemented.)
diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 5e5a923ac7..34d6078908 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -1,5 +1,5 @@ @@ -158,7 +158,7 @@ SELECT setseed(value); for SET timezone TO value. The syntax SET TIME ZONE allows special syntax for the time zone specification. Here are examples of valid - values (but note some are accepted only on some platforms): + values: @@ -169,14 +169,6 @@ SELECT setseed(value); - - 'Portugal' - - - The time zone for Portugal. - - - 'Europe/Rome' @@ -216,7 +208,8 @@ SELECT setseed(value); See for more information - about time zones. + about time zones. Also, + has a list of the recognized names for time zones.
@@ -253,15 +246,16 @@ SET datestyle TO postgres, dmy;
- Set the time zone for Berkeley, California, using quotes to - preserve the uppercase spelling of the time zone name: + Set the time zone for Berkeley, California: SET TIME ZONE 'PST8PDT'; -SELECT current_timestamp AS today; + + - today -------------------------------- - 2003-04-29 15:02:01.218622-07 + + Set the time zone for Italy: + +SET TIME ZONE 'Europe/Rome';