summaryrefslogtreecommitdiff
path: root/src/timezone/localtime.c
Commit message (Collapse)AuthorAgeFilesLines
* Prepare code to be built by MSVC:Bruce Momjian2006-06-071-2/+2
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Suppress a couple of minor compiler warnings, per Magnus.Tom Lane2006-04-091-2/+2
|
* Standard pgindent run for 8.1.Bruce Momjian2005-10-151-89/+83
|
* Cosmetic improvements to the timezone code: remove the use of theNeil Conway2005-06-201-68/+68
| | | | | 'register' qualifier, make some function declarations more consistent, and so on.
* Attached patch gets rid of the global timezone in the following steps:Bruce Momjian2005-04-191-78/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changes the APIs to the timezone functions to take a pg_tz pointer as an argument, representing the timezone to use for the selected operation. * Adds a global_timezone variable that represents the current timezone in the backend as set by SET TIMEZONE (or guc, or env, etc). * Implements a hash-table cache of loaded tables, so we don't have to read and parse the TZ file everytime we change a timezone. While not necesasry now (we don't change timezones very often), I beleive this will be necessary (or at least good) when "multiple timezones in the same query" is eventually implemented. And code-wise, this was the time to do it. There are no user-visible changes at this time. Implementing the "multiple zones in one query" is a later step... This also gets rid of some of the cruft needed to "back out a timezone change", since we previously couldn't check a timezone unless it was activated first. Passes regression tests on win32, linux (slackware 10) and solaris x86. Magnus Hagander
* Invent pg_next_dst_boundary() and rewrite DetermineLocalTimeZone() toTom Lane2004-11-011-1/+95
| | | | | | | | | | | | use it, as per my proposal of yesterday. This gives us a means of determining the zone offset to impute to an unlabeled timestamp that is both efficient and reliable, unlike all our previous tries involving mktime() and localtime(). The behavior for invalid or ambiguous times at a DST transition is fixed to be really and truly "assume standard time", fixing a bug that has come and gone repeatedly but was back again in 7.4. (There is some ongoing discussion about whether we should raise an error instead, but for the moment I'll make it do what it was previously intended to do.)
* Pgindent run for 8.0.Bruce Momjian2004-08-291-29/+30
|
* Adjust our timezone library to use pg_time_t (typedef'd as int64) inTom Lane2004-06-031-346/+39
| | | | | | | | | | | | | | | | | | | place of time_t, as per prior discussion. The behavior does not change on machines without a 64-bit-int type, but on machines with one, which is most, we are rid of the bizarre boundary behavior at the edges of the 32-bit-time_t range (1901 and 2038). The system will now treat times over the full supported timestamp range as being in your local time zone. It may seem a little bizarre to consider that times in 4000 BC are PST or EST, but this is surely at least as reasonable as propagating Gregorian calendar rules back that far. I did not modify the format of the zic timezone database files, which means that for the moment the system will not know about daylight-savings periods outside the range 1901-2038. Given the way the files are set up, it's not a simple decision like 'widen to 64 bits'; we have to actually think about the range of years that need to be supported. We should probably inquire what the plans of the upstream zic people are before making any decisions of our own.
* pgindent did a pretty awful job on the timezone code, particularly withTom Lane2004-05-211-171/+182
| | | | respect to doubly-starred comment blocks. Do some manual cleanup.
* Pgindent timezone file, per request from Tom.Bruce Momjian2004-05-211-428/+563
|
* Integrate src/timezone library for all platforms. There is more we canTom Lane2004-05-211-566/+86
| | | | | | and should do now that we control our own destiny for timezone handling, but this commit gets the bulk of the picayune diffs in place. Magnus Hagander and Tom Lane.
* Convert DOS newlines to Unix newlines.Bruce Momjian2004-04-301-1712/+1712
|
* Timezone library changes to map into our backend code.Bruce Momjian2004-04-301-0/+5
|
* Add Olson's public domain timezone library to src/timezone.Bruce Momjian2004-04-301-0/+1707