Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
datetime-config-files.html98 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>B.4. Date/Time Configuration Files</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="datetime-keywords.html" title="B.3. Date/Time Key Words" /><link rel="next" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">B.4. Date/Time Configuration Files</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="datetime-keywords.html" title="B.3. Date/Time Key Words">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="datetime-appendix.html" title="Appendix B. Date/Time Support">Up</a></td><th width="60%" align="center">Appendix B. Date/Time Support</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications">Next</a></td></tr></table><hr /></div><div class="sect1" id="DATETIME-CONFIG-FILES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">B.4. Date/Time Configuration Files <a href="#DATETIME-CONFIG-FILES" class="id_link">#</a></h2></div></div></div><a id="id-1.11.3.7.2" class="indexterm"></a><p>3    Since timezone abbreviations are not well standardized,4    <span class="productname">PostgreSQL</span> provides a means to customize5    the set of abbreviations accepted by the server.  The6    <a class="xref" href="runtime-config-client.html#GUC-TIMEZONE-ABBREVIATIONS">timezone_abbreviations</a> run-time parameter7    determines the active set of abbreviations.  While this parameter8    can be altered by any database user, the possible values for it9    are under the control of the database administrator — they10    are in fact names of configuration files stored in11    <code class="filename">.../share/timezonesets/</code> of the installation directory.12    By adding or altering files in that directory, the administrator13    can set local policy for timezone abbreviations.14   </p><p>15    <code class="varname">timezone_abbreviations</code> can be set to any file name16    found in <code class="filename">.../share/timezonesets/</code>, if the file's name17    is entirely alphabetic.  (The prohibition against non-alphabetic18    characters in <code class="varname">timezone_abbreviations</code> prevents reading19    files outside the intended directory, as well as reading editor20    backup files and other extraneous files.)21   </p><p>22    A timezone abbreviation file can contain blank lines and comments23    beginning with <code class="literal">#</code>.  Non-comment lines must have one of24    these formats:25 26</p><pre class="synopsis">27<em class="replaceable"><code>zone_abbreviation</code></em> <em class="replaceable"><code>offset</code></em>28<em class="replaceable"><code>zone_abbreviation</code></em> <em class="replaceable"><code>offset</code></em> D29<em class="replaceable"><code>zone_abbreviation</code></em> <em class="replaceable"><code>time_zone_name</code></em>30@INCLUDE <em class="replaceable"><code>file_name</code></em>31@OVERRIDE32</pre><p>33   </p><p>34    A <em class="replaceable"><code>zone_abbreviation</code></em> is just the abbreviation35    being defined.  An <em class="replaceable"><code>offset</code></em> is an integer giving36    the equivalent offset in seconds from UTC, positive being east from37    Greenwich and negative being west.  For example, -18000 would be five38    hours west of Greenwich, or North American east coast standard time.39    <code class="literal">D</code> indicates that the zone name represents local40    daylight-savings time rather than standard time.41   </p><p>42    Alternatively, a <em class="replaceable"><code>time_zone_name</code></em> can be given, referencing43    a zone name defined in the IANA timezone database.  The zone's definition44    is consulted to see whether the abbreviation is or has been in use in45    that zone, and if so, the appropriate meaning is used — that is,46    the meaning that was currently in use at the timestamp whose value is47    being determined, or the meaning in use immediately before that if it48    wasn't current at that time, or the oldest meaning if it was used only49    after that time.  This behavior is essential for dealing with50    abbreviations whose meaning has historically varied.  It is also allowed51    to define an abbreviation in terms of a zone name in which that52    abbreviation does not appear; then using the abbreviation is just53    equivalent to writing out the zone name.54   </p><div class="tip"><h3 class="title">Tip</h3><p>55     Using a simple integer <em class="replaceable"><code>offset</code></em> is preferred56     when defining an abbreviation whose offset from UTC has never changed,57     as such abbreviations are much cheaper to process than those that58     require consulting a time zone definition.59    </p></div><p>60    The <code class="literal">@INCLUDE</code> syntax allows inclusion of another file in the61    <code class="filename">.../share/timezonesets/</code> directory.  Inclusion can be nested,62    to a limited depth.63   </p><p>64    The <code class="literal">@OVERRIDE</code> syntax indicates that subsequent entries in the65    file can override previous entries (typically, entries obtained from66    included files).  Without this, conflicting definitions of the same67    timezone abbreviation are considered an error.68   </p><p>69    In an unmodified installation, the file <code class="filename">Default</code> contains70    all the non-conflicting time zone abbreviations for most of the world.71    Additional files <code class="filename">Australia</code> and <code class="filename">India</code> are72    provided for those regions: these files first include the73    <code class="literal">Default</code> file and then add or modify abbreviations as needed.74   </p><p>75    For reference purposes, a standard installation also contains files76    <code class="filename">Africa.txt</code>, <code class="filename">America.txt</code>, etc., containing77    information about every time zone abbreviation known to be in use78    according to the IANA timezone database.  The zone name79    definitions found in these files can be copied and pasted into a custom80    configuration file as needed.  Note that these files cannot be directly81    referenced as <code class="varname">timezone_abbreviations</code> settings, because of82    the dot embedded in their names.83   </p><div class="note"><h3 class="title">Note</h3><p>84     If an error occurs while reading the time zone abbreviation set, no new85     value is applied and the old set is kept. If the error occurs while86     starting the database, startup fails.87    </p></div><div class="caution"><h3 class="title">Caution</h3><p>88     Time zone abbreviations defined in the configuration file override89     non-timezone meanings built into <span class="productname">PostgreSQL</span>.90     For example, the <code class="filename">Australia</code> configuration file defines91     <code class="literal">SAT</code> (for South Australian Standard Time).  When this92     file is active, <code class="literal">SAT</code> will not be recognized as an abbreviation93     for Saturday.94    </p></div><div class="caution"><h3 class="title">Caution</h3><p>95     If you modify files in <code class="filename">.../share/timezonesets/</code>,96     it is up to you to make backups — a normal database dump97     will not include this directory.98    </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="datetime-keywords.html" title="B.3. Date/Time Key Words">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="datetime-appendix.html" title="Appendix B. Date/Time Support">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="datetime-posix-timezone-specs.html" title="B.5. POSIX Time Zone Specifications">Next</a></td></tr><tr><td width="40%" align="left" valign="top">B.3. Date/Time Key Words </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> B.5. <acronym class="acronym">POSIX</acronym> Time Zone Specifications</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai