PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include <fcntl.h>
#include <time.h>
#include "common/file_utils.h"
#include "datatype/timestamp.h"
#include "miscadmin.h"
#include "pgtz.h"
#include "storage/fd.h"
#include "utils/hsearch.h"
Go to the source code of this file.
Data Structures | |
struct | pg_tz_cache |
struct | pg_tzenum |
Macros | |
#define | MAX_TZDIR_DEPTH 10 |
Functions | |
static bool | scan_directory_ci (const char *dirname, const char *fname, int fnamelen, char *canonname, int canonnamelen) |
static const char * | pg_TZDIR (void) |
int | pg_open_tzfile (const char *name, char *canonname) |
static bool | init_timezone_hashtable (void) |
pg_tz * | pg_tzset (const char *tzname) |
pg_tz * | pg_tzset_offset (long gmtoffset) |
void | pg_timezone_initialize (void) |
pg_tzenum * | pg_tzenumerate_start (void) |
void | pg_tzenumerate_end (pg_tzenum *dir) |
pg_tz * | pg_tzenumerate_next (pg_tzenum *dir) |
Variables | |
pg_tz * | session_timezone = NULL |
pg_tz * | log_timezone = NULL |
static HTAB * | timezone_cache = NULL |
|
static |
Definition at line 202 of file pgtz.c.
References HASHCTL::entrysize, hash_create(), HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, timezone_cache, and TZ_STRLEN_MAX.
Referenced by pg_tzset().
int pg_open_tzfile | ( | const char * | name, |
char * | canonname | ||
) |
Definition at line 76 of file pgtz.c.
References MAXPGPATH, name, PG_BINARY, pg_TZDIR(), scan_directory_ci(), strlcpy(), and TZ_STRLEN_MAX.
void pg_timezone_initialize | ( | void | ) |
Definition at line 361 of file pgtz.c.
References log_timezone, pg_tzset(), and session_timezone.
Referenced by InitializeGUCOptions().
|
static |
Definition at line 43 of file pgtz.c.
References get_share_path(), MAXPGPATH, my_exec_path, and strlcpy().
Referenced by pg_open_tzfile(), and pg_tzenumerate_start().
void pg_tzenumerate_end | ( | pg_tzenum * | dir | ) |
Definition at line 414 of file pgtz.c.
References pg_tzenum::depth, pg_tzenum::dirdesc, pg_tzenum::dirname, FreeDir(), and pfree().
Definition at line 426 of file pgtz.c.
References AllocateDir(), pg_tzenum::baselen, dirent::d_name, pg_tzenum::depth, pg_tzenum::dirdesc, pg_tzenum::dirname, ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), ERROR, FreeDir(), get_dirent_type(), MAX_TZDIR_DEPTH, MAXPGPATH, pfree(), pg_tz_acceptable(), PGFILETYPE_DIR, pstrdup(), ReadDir(), snprintf, pg_tz::state, strlcpy(), pg_tzenum::tz, tzload(), and pg_tz::TZname.
pg_tzenum* pg_tzenumerate_start | ( | void | ) |
Definition at line 397 of file pgtz.c.
References AllocateDir(), pg_tzenum::baselen, pg_tzenum::depth, pg_tzenum::dirdesc, pg_tzenum::dirname, ereport, errcode_for_file_access(), errmsg(), ERROR, palloc0(), pg_TZDIR(), and pstrdup().
pg_tz* pg_tzset | ( | const char * | tzname | ) |
Definition at line 234 of file pgtz.c.
References elog, ERROR, HASH_ENTER, HASH_FIND, hash_search(), init_timezone_hashtable(), pg_toupper(), pg_tz::state, timezone_cache, pg_tz_cache::tz, TZ_STRLEN_MAX, tzload(), pg_tz::TZname, and tzparse().
Referenced by check_log_timezone(), check_timezone(), DecodeDateTime(), DecodeTimeOnly(), DecodeTimezoneName(), FetchDynamicTimeZone(), pg_timezone_initialize(), and pg_tzset_offset().
pg_tz* pg_tzset_offset | ( | long | gmtoffset | ) |
Definition at line 320 of file pgtz.c.
References pg_tzset(), SECS_PER_HOUR, SECS_PER_MINUTE, and snprintf.
Referenced by check_timezone(), and DecodeTimezoneNameToTz().
|
static |
Definition at line 151 of file pgtz.c.
References AllocateDir(), dirent::d_name, FreeDir(), LOG, pg_strncasecmp(), ReadDirExtended(), and strlcpy().
Referenced by pg_open_tzfile().
pg_tz* log_timezone = NULL |
Definition at line 31 of file pgtz.c.
Referenced by assign_log_timezone(), build_backup_content(), get_formatted_log_time(), get_formatted_start_time(), log_status_format(), logfile_getname(), pg_timezone_initialize(), set_next_rotation_time(), show_log_timezone(), and str_time().
pg_tz* session_timezone = NULL |
Definition at line 28 of file pgtz.c.
Referenced by assign_timezone(), date2timestamptz_opt_overflow(), DecodeDateTime(), DecodeTimeOnly(), executeDateTimeMethod(), generate_series_timestamptz_internal(), GetCurrentTimeUsec(), pg_timezone_initialize(), show_timezone(), time_timetz(), timeofday(), timestamp2timestamptz_opt_overflow(), timestamp2tm(), TimestampTimestampTzRequiresRewrite(), timestamptz_pl_interval_internal(), timestamptz_trunc(), timetz_at_local(), and to_timestamp().
|
static |
Definition at line 198 of file pgtz.c.
Referenced by init_timezone_hashtable(), and pg_tzset().