|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <ctype.h>#include <unistd.h>#include <math.h>#include <float.h>#include <limits.h>#include <wctype.h>#include "catalog/pg_collation.h"#include "catalog/pg_type.h"#include "common/int.h"#include "common/unicode_case.h"#include "common/unicode_category.h"#include "mb/pg_wchar.h"#include "nodes/miscnodes.h"#include "parser/scansup.h"#include "utils/builtins.h"#include "utils/date.h"#include "utils/datetime.h"#include "utils/formatting.h"#include "utils/memutils.h"#include "utils/numeric.h"#include "utils/pg_locale.h"#include "varatt.h"
Go to the source code of this file.
Data Structures | |
| struct | KeySuffix |
| struct | KeyWord |
| struct | FormatNode |
| struct | NUMDesc |
| struct | DCHCacheEntry |
| struct | NUMCacheEntry |
| struct | TmFromChar |
| struct | fmt_tz |
| struct | fmt_tm |
| struct | TmToChar |
| struct | NUMProc |
Macros | |
| #define | DCH_FLAG 0x1 /* DATE-TIME flag */ |
| #define | NUM_FLAG 0x2 /* NUMBER flag */ |
| #define | STD_FLAG 0x4 /* STANDARD flag */ |
| #define | KeyWord_INDEX_SIZE ('~' - ' ') |
| #define | KeyWord_INDEX_FILTER(_c) ((_c) <= ' ' || (_c) >= '~' ? 0 : 1) |
| #define | DCH_MAX_ITEM_SIZ 12 /* max localized day name */ |
| #define | NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */ |
| #define | ADJUST_YEAR(year, is_interval) ((is_interval) ? (year) : ((year) <= 0 ? -((year) - 1) : (year))) |
| #define | A_D_STR "A.D." |
| #define | a_d_STR "a.d." |
| #define | AD_STR "AD" |
| #define | ad_STR "ad" |
| #define | B_C_STR "B.C." |
| #define | b_c_STR "b.c." |
| #define | BC_STR "BC" |
| #define | bc_STR "bc" |
| #define | A_M_STR "A.M." |
| #define | a_m_STR "a.m." |
| #define | AM_STR "AM" |
| #define | am_STR "am" |
| #define | P_M_STR "P.M." |
| #define | p_m_STR "p.m." |
| #define | PM_STR "PM" |
| #define | pm_STR "pm" |
| #define | IS_VALID_SUB_COMB(curr, next) |
| #define | ROMAN_VAL(r) |
| #define | MAX_ROMAN_LEN 15 |
| #define | NUM_F_DECIMAL (1 << 1) |
| #define | NUM_F_LDECIMAL (1 << 2) |
| #define | NUM_F_ZERO (1 << 3) |
| #define | NUM_F_BLANK (1 << 4) |
| #define | NUM_F_FILLMODE (1 << 5) |
| #define | NUM_F_LSIGN (1 << 6) |
| #define | NUM_F_BRACKET (1 << 7) |
| #define | NUM_F_MINUS (1 << 8) |
| #define | NUM_F_PLUS (1 << 9) |
| #define | NUM_F_ROMAN (1 << 10) |
| #define | NUM_F_MULTI (1 << 11) |
| #define | NUM_F_PLUS_POST (1 << 12) |
| #define | NUM_F_MINUS_POST (1 << 13) |
| #define | NUM_F_EEEE (1 << 14) |
| #define | IS_DECIMAL(_f) ((_f)->flag & NUM_F_DECIMAL) |
| #define | IS_LDECIMAL(_f) ((_f)->flag & NUM_F_LDECIMAL) |
| #define | IS_ZERO(_f) ((_f)->flag & NUM_F_ZERO) |
| #define | IS_BLANK(_f) ((_f)->flag & NUM_F_BLANK) |
| #define | IS_FILLMODE(_f) ((_f)->flag & NUM_F_FILLMODE) |
| #define | IS_BRACKET(_f) ((_f)->flag & NUM_F_BRACKET) |
| #define | IS_MINUS(_f) ((_f)->flag & NUM_F_MINUS) |
| #define | IS_LSIGN(_f) ((_f)->flag & NUM_F_LSIGN) |
| #define | IS_PLUS(_f) ((_f)->flag & NUM_F_PLUS) |
| #define | IS_ROMAN(_f) ((_f)->flag & NUM_F_ROMAN) |
| #define | IS_MULTI(_f) ((_f)->flag & NUM_F_MULTI) |
| #define | IS_EEEE(_f) ((_f)->flag & NUM_F_EEEE) |
| #define | DCH_CACHE_OVERHEAD MAXALIGN(sizeof(bool) + sizeof(int)) |
| #define | NUM_CACHE_OVERHEAD MAXALIGN(sizeof(bool) + sizeof(int) + sizeof(NUMDesc)) |
| #define | DCH_CACHE_SIZE ((2048 - DCH_CACHE_OVERHEAD) / (sizeof(FormatNode) + sizeof(char)) - 1) |
| #define | NUM_CACHE_SIZE ((1024 - NUM_CACHE_OVERHEAD) / (sizeof(FormatNode) + sizeof(char)) - 1) |
| #define | DCH_CACHE_ENTRIES 20 |
| #define | NUM_CACHE_ENTRIES 20 |
| #define | DEBUG_TMFC(_X) |
| #define | DEBUG_TM(_X) |
| #define | tmtcTm(_X) (&(_X)->tm) |
| #define | tmtcTzn(_X) ((_X)->tzn) |
| #define | tmtcFsec(_X) ((_X)->fsec) |
| #define | COPY_tm(_DST, _SRC) |
| #define | ZERO_tm(_X) |
| #define | ZERO_tmtc(_X) |
| #define | INVALID_FOR_INTERVAL |
| #define | DCH_SUFFIX_FM 0x01 |
| #define | DCH_SUFFIX_TH 0x02 |
| #define | DCH_SUFFIX_th 0x04 |
| #define | DCH_SUFFIX_SP 0x08 |
| #define | DCH_SUFFIX_TM 0x10 |
| #define | TM_SUFFIX_LEN 2 |
| #define | DCH_DATED 0x01 |
| #define | DCH_TIMED 0x02 |
| #define | DCH_ZONED 0x04 |
| #define | OVERLOAD_TEST (Np->inout_p >= Np->inout + input_len) |
| #define | AMOUNT_TEST(s) (Np->inout_p <= Np->inout + (input_len - (s))) |
| #define | SKIP_THth(ptr, _suf) |
| #define | DCH_to_char_fsec(frac_fmt, frac_val) |
| #define | IS_PREDEC_SPACE(_n) |
| #define | NUM_TOCHAR_prepare |
| #define | NUM_TOCHAR_finish |
Typedefs | |
| typedef struct TmToChar | TmToChar |
| typedef struct NUMProc | NUMProc |
Functions | |
| static bool | IS_SUFFIX_TH (uint8 _s) |
| static bool | IS_SUFFIX_th (uint8 _s) |
| static bool | IS_SUFFIX_THth (uint8 _s) |
| static enum TH_Case | SUFFIX_TH_TYPE (uint8 _s) |
| static bool | IS_SUFFIX_FM (uint8 _s) |
| static bool | IS_SUFFIX_TM (uint8 _s) |
| static const KeyWord * | index_seq_search (const char *str, const KeyWord *kw, const int *index) |
| static const KeySuffix * | suff_search (const char *str, const KeySuffix *suf, enum KeySuffixType type) |
| static bool | is_separator_char (const char *str) |
| static void | NUMDesc_prepare (NUMDesc *num, FormatNode *n) |
| static void | parse_format (FormatNode *node, const char *str, const KeyWord *kw, const KeySuffix *suf, const int *index, uint32 flags, NUMDesc *Num) |
| static void | DCH_to_char (FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid collid) |
| static void | DCH_from_char (FormatNode *node, const char *in, TmFromChar *out, Oid collid, bool std, Node *escontext) |
| static const char * | get_th (const char *num, enum TH_Case type) |
| static char * | str_numth (char *dest, const char *num, enum TH_Case type) |
| static int | adjust_partial_year_to_2020 (int year) |
| static size_t | strspace_len (const char *str) |
| static bool | from_char_set_mode (TmFromChar *tmfc, const FromCharDateMode mode, Node *escontext) |
| static bool | from_char_set_int (int *dest, const int value, const FormatNode *node, Node *escontext) |
| static int | from_char_parse_int_len (int *dest, const char **src, const size_t len, FormatNode *node, Node *escontext) |
| static int | from_char_parse_int (int *dest, const char **src, FormatNode *node, Node *escontext) |
| static int | seq_search_ascii (const char *name, const char *const *array, size_t *len) |
| static int | seq_search_localized (const char *name, char **array, size_t *len, Oid collid) |
| static bool | from_char_seq_search (int *dest, const char **src, const char *const *array, char **localized_array, Oid collid, FormatNode *node, Node *escontext) |
| static bool | do_to_timestamp (const text *date_txt, const text *fmt, Oid collid, bool std, struct pg_tm *tm, fsec_t *fsec, struct fmt_tz *tz, int *fprec, uint32 *flags, Node *escontext) |
| static void | fill_str (char *str, int c, int max) |
| static FormatNode * | NUM_cache (int len, NUMDesc *Num, const text *pars_str, bool *shouldFree) |
| static char * | int_to_roman (int number) |
| static int | roman_to_int (NUMProc *Np, size_t input_len) |
| static void | NUM_prepare_locale (NUMProc *Np) |
| static char * | get_last_relevant_decnum (const char *num) |
| static void | NUM_numpart_from_char (NUMProc *Np, int id, size_t input_len) |
| static void | NUM_numpart_to_char (NUMProc *Np, int id) |
| static char * | NUM_processor (FormatNode *node, NUMDesc *Num, char *inout, char *number, size_t input_len, int to_char_out_pre_spaces, int sign, bool is_to_char, Oid collid) |
| static DCHCacheEntry * | DCH_cache_getnew (const char *str, bool std) |
| static DCHCacheEntry * | DCH_cache_search (const char *str, bool std) |
| static DCHCacheEntry * | DCH_cache_fetch (const char *str, bool std) |
| static NUMCacheEntry * | NUM_cache_getnew (const char *str) |
| static NUMCacheEntry * | NUM_cache_search (const char *str) |
| static NUMCacheEntry * | NUM_cache_fetch (const char *str) |
| char * | str_tolower (const char *buff, size_t nbytes, Oid collid) |
| char * | str_toupper (const char *buff, size_t nbytes, Oid collid) |
| char * | str_initcap (const char *buff, size_t nbytes, Oid collid) |
| char * | str_casefold (const char *buff, size_t nbytes, Oid collid) |
| char * | asc_tolower (const char *buff, size_t nbytes) |
| char * | asc_toupper (const char *buff, size_t nbytes) |
| char * | asc_initcap (const char *buff, size_t nbytes) |
| static char * | str_tolower_z (const char *buff, Oid collid) |
| static char * | str_toupper_z (const char *buff, Oid collid) |
| static char * | str_initcap_z (const char *buff, Oid collid) |
| static char * | asc_tolower_z (const char *buff) |
| static char * | asc_toupper_z (const char *buff) |
| static bool | is_next_separator (FormatNode *n) |
| static void | DCH_prevent_counter_overflow (void) |
| static int | DCH_datetime_type (FormatNode *node) |
| static text * | datetime_to_char_body (TmToChar *tmtc, const text *fmt, bool is_interval, Oid collid) |
| Datum | timestamp_to_char (PG_FUNCTION_ARGS) |
| Datum | timestamptz_to_char (PG_FUNCTION_ARGS) |
| Datum | interval_to_char (PG_FUNCTION_ARGS) |
| Datum | to_timestamp (PG_FUNCTION_ARGS) |
| Datum | to_date (PG_FUNCTION_ARGS) |
| Datum | parse_datetime (text *date_txt, text *fmt, Oid collid, bool strict, Oid *typid, int32 *typmod, int *tz, Node *escontext) |
| bool | datetime_format_has_tz (const char *fmt_str) |
| static void | NUM_prevent_counter_overflow (void) |
| static void | NUM_eat_non_data_chars (NUMProc *Np, int n, size_t input_len) |
| Datum | numeric_to_number (PG_FUNCTION_ARGS) |
| Datum | numeric_to_char (PG_FUNCTION_ARGS) |
| Datum | int4_to_char (PG_FUNCTION_ARGS) |
| Datum | int8_to_char (PG_FUNCTION_ARGS) |
| Datum | float4_to_char (PG_FUNCTION_ARGS) |
| Datum | float8_to_char (PG_FUNCTION_ARGS) |
Variables | |
| static const char *const | months_full [] |
| static const char *const | days_short [] |
| static const char *const | adbc_strings [] = {ad_STR, bc_STR, AD_STR, BC_STR, NULL} |
| static const char *const | adbc_strings_long [] = {a_d_STR, b_c_STR, A_D_STR, B_C_STR, NULL} |
| static const char *const | ampm_strings [] = {am_STR, pm_STR, AM_STR, PM_STR, NULL} |
| static const char *const | ampm_strings_long [] = {a_m_STR, p_m_STR, A_M_STR, P_M_STR, NULL} |
| static const char *const | rm_months_upper [] |
| static const char *const | rm_months_lower [] |
| static const char *const | rm1 [] = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", NULL} |
| static const char *const | rm10 [] = {"X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", NULL} |
| static const char *const | rm100 [] = {"C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", NULL} |
| static const char *const | numTH [] = {"ST", "ND", "RD", "TH", NULL} |
| static const char *const | numth [] = {"st", "nd", "rd", "th", NULL} |
| static DCHCacheEntry * | DCHCache [DCH_CACHE_ENTRIES] |
| static int | n_DCHCache = 0 |
| static int | DCHCounter = 0 |
| static NUMCacheEntry * | NUMCache [NUM_CACHE_ENTRIES] |
| static int | n_NUMCache = 0 |
| static int | NUMCounter = 0 |
| static const KeySuffix | DCH_suff [] |
| static const KeyWord | DCH_keywords [] |
| static const KeyWord | NUM_keywords [] |
| static const int | DCH_index [KeyWord_INDEX_SIZE] |
| static const int | NUM_index [KeyWord_INDEX_SIZE] |
| #define A_D_STR "A.D." |
Definition at line 195 of file formatting.c.
| #define a_d_STR "a.d." |
Definition at line 196 of file formatting.c.
| #define A_M_STR "A.M." |
Definition at line 221 of file formatting.c.
| #define a_m_STR "a.m." |
Definition at line 222 of file formatting.c.
| #define AD_STR "AD" |
Definition at line 197 of file formatting.c.
| #define ad_STR "ad" |
Definition at line 198 of file formatting.c.
| #define ADJUST_YEAR | ( | year, | |
| is_interval | |||
| ) | ((is_interval) ? (year) : ((year) <= 0 ? -((year) - 1) : (year))) |
Definition at line 193 of file formatting.c.
| #define AM_STR "AM" |
Definition at line 223 of file formatting.c.
| #define am_STR "am" |
Definition at line 224 of file formatting.c.
| #define AMOUNT_TEST | ( | s | ) | (Np->inout_p <= Np->inout + (input_len - (s))) |
Definition at line 1070 of file formatting.c.
| #define B_C_STR "B.C." |
Definition at line 200 of file formatting.c.
| #define b_c_STR "b.c." |
Definition at line 201 of file formatting.c.
| #define BC_STR "BC" |
Definition at line 202 of file formatting.c.
| #define bc_STR "bc" |
Definition at line 203 of file formatting.c.
| #define COPY_tm | ( | _DST, | |
| _SRC | |||
| ) |
Definition at line 511 of file formatting.c.
| #define DCH_CACHE_ENTRIES 20 |
Definition at line 387 of file formatting.c.
| #define DCH_CACHE_OVERHEAD MAXALIGN(sizeof(bool) + sizeof(int)) |
Definition at line 377 of file formatting.c.
| #define DCH_CACHE_SIZE ((2048 - DCH_CACHE_OVERHEAD) / (sizeof(FormatNode) + sizeof(char)) - 1) |
Definition at line 382 of file formatting.c.
| #define DCH_DATED 0x01 |
Definition at line 1060 of file formatting.c.
| #define DCH_FLAG 0x1 /* DATE-TIME flag */ |
Definition at line 98 of file formatting.c.
| #define DCH_MAX_ITEM_SIZ 12 /* max localized day name */ |
Definition at line 111 of file formatting.c.
| #define DCH_SUFFIX_FM 0x01 |
Definition at line 558 of file formatting.c.
| #define DCH_SUFFIX_SP 0x08 |
Definition at line 561 of file formatting.c.
| #define DCH_SUFFIX_TH 0x02 |
Definition at line 559 of file formatting.c.
| #define DCH_SUFFIX_th 0x04 |
Definition at line 560 of file formatting.c.
| #define DCH_SUFFIX_TM 0x10 |
Definition at line 562 of file formatting.c.
| #define DCH_TIMED 0x02 |
Definition at line 1061 of file formatting.c.
| #define DCH_to_char_fsec | ( | frac_fmt, | |
| frac_val | |||
| ) |
| #define DCH_ZONED 0x04 |
Definition at line 1062 of file formatting.c.
| #define DEBUG_TM | ( | _X | ) |
Definition at line 476 of file formatting.c.
| #define DEBUG_TMFC | ( | _X | ) |
Definition at line 475 of file formatting.c.
| #define INVALID_FOR_INTERVAL |
| #define IS_BLANK | ( | _f | ) | ((_f)->flag & NUM_F_BLANK) |
Definition at line 350 of file formatting.c.
| #define IS_BRACKET | ( | _f | ) | ((_f)->flag & NUM_F_BRACKET) |
Definition at line 352 of file formatting.c.
| #define IS_DECIMAL | ( | _f | ) | ((_f)->flag & NUM_F_DECIMAL) |
Definition at line 347 of file formatting.c.
| #define IS_EEEE | ( | _f | ) | ((_f)->flag & NUM_F_EEEE) |
Definition at line 358 of file formatting.c.
| #define IS_FILLMODE | ( | _f | ) | ((_f)->flag & NUM_F_FILLMODE) |
Definition at line 351 of file formatting.c.
| #define IS_LDECIMAL | ( | _f | ) | ((_f)->flag & NUM_F_LDECIMAL) |
Definition at line 348 of file formatting.c.
| #define IS_LSIGN | ( | _f | ) | ((_f)->flag & NUM_F_LSIGN) |
Definition at line 354 of file formatting.c.
| #define IS_MINUS | ( | _f | ) | ((_f)->flag & NUM_F_MINUS) |
Definition at line 353 of file formatting.c.
| #define IS_MULTI | ( | _f | ) | ((_f)->flag & NUM_F_MULTI) |
Definition at line 357 of file formatting.c.
| #define IS_PLUS | ( | _f | ) | ((_f)->flag & NUM_F_PLUS) |
Definition at line 355 of file formatting.c.
| #define IS_PREDEC_SPACE | ( | _n | ) |
Definition at line 5532 of file formatting.c.
| #define IS_ROMAN | ( | _f | ) | ((_f)->flag & NUM_F_ROMAN) |
Definition at line 356 of file formatting.c.
| #define IS_VALID_SUB_COMB | ( | curr, | |
| next | |||
| ) |
Definition at line 266 of file formatting.c.
| #define IS_ZERO | ( | _f | ) | ((_f)->flag & NUM_F_ZERO) |
Definition at line 349 of file formatting.c.
| #define KeyWord_INDEX_FILTER | ( | _c | ) | ((_c) <= ' ' || (_c) >= '~' ? 0 : 1) |
Definition at line 106 of file formatting.c.
| #define KeyWord_INDEX_SIZE ('~' - ' ') |
Definition at line 105 of file formatting.c.
| #define MAX_ROMAN_LEN 15 |
Definition at line 286 of file formatting.c.
| #define NUM_CACHE_ENTRIES 20 |
Definition at line 388 of file formatting.c.
Definition at line 379 of file formatting.c.
| #define NUM_CACHE_SIZE ((1024 - NUM_CACHE_OVERHEAD) / (sizeof(FormatNode) + sizeof(char)) - 1) |
Definition at line 384 of file formatting.c.
| #define NUM_F_BLANK (1 << 4) |
Definition at line 332 of file formatting.c.
| #define NUM_F_BRACKET (1 << 7) |
Definition at line 335 of file formatting.c.
| #define NUM_F_DECIMAL (1 << 1) |
Definition at line 329 of file formatting.c.
| #define NUM_F_EEEE (1 << 14) |
Definition at line 342 of file formatting.c.
| #define NUM_F_FILLMODE (1 << 5) |
Definition at line 333 of file formatting.c.
| #define NUM_F_LDECIMAL (1 << 2) |
Definition at line 330 of file formatting.c.
| #define NUM_F_LSIGN (1 << 6) |
Definition at line 334 of file formatting.c.
| #define NUM_F_MINUS (1 << 8) |
Definition at line 336 of file formatting.c.
| #define NUM_F_MINUS_POST (1 << 13) |
Definition at line 341 of file formatting.c.
| #define NUM_F_MULTI (1 << 11) |
Definition at line 339 of file formatting.c.
| #define NUM_F_PLUS (1 << 9) |
Definition at line 337 of file formatting.c.
| #define NUM_F_PLUS_POST (1 << 12) |
Definition at line 340 of file formatting.c.
| #define NUM_F_ROMAN (1 << 10) |
Definition at line 338 of file formatting.c.
| #define NUM_F_ZERO (1 << 3) |
Definition at line 331 of file formatting.c.
| #define NUM_FLAG 0x2 /* NUMBER flag */ |
Definition at line 99 of file formatting.c.
| #define NUM_MAX_ITEM_SIZ 8 /* roman number (RN has 15 chars) */ |
Definition at line 112 of file formatting.c.
| #define NUM_TOCHAR_finish |
Definition at line 6224 of file formatting.c.
| #define NUM_TOCHAR_prepare |
Definition at line 6212 of file formatting.c.
| #define OVERLOAD_TEST (Np->inout_p >= Np->inout + input_len) |
Definition at line 1069 of file formatting.c.
| #define P_M_STR "P.M." |
Definition at line 226 of file formatting.c.
| #define p_m_STR "p.m." |
Definition at line 227 of file formatting.c.
| #define PM_STR "PM" |
Definition at line 228 of file formatting.c.
| #define pm_STR "pm" |
Definition at line 229 of file formatting.c.
| #define ROMAN_VAL | ( | r | ) |
Definition at line 274 of file formatting.c.
| #define SKIP_THth | ( | ptr, | |
| _suf | |||
| ) |
Definition at line 1998 of file formatting.c.
| #define STD_FLAG 0x4 /* STANDARD flag */ |
Definition at line 100 of file formatting.c.
| #define TM_SUFFIX_LEN 2 |
Definition at line 607 of file formatting.c.
| #define tmtcFsec | ( | _X | ) | ((_X)->fsec) |
Definition at line 508 of file formatting.c.
| #define tmtcTm | ( | _X | ) | (&(_X)->tm) |
Definition at line 506 of file formatting.c.
| #define tmtcTzn | ( | _X | ) | ((_X)->tzn) |
Definition at line 507 of file formatting.c.
| #define ZERO_tm | ( | _X | ) |
Definition at line 525 of file formatting.c.
| #define ZERO_tmtc | ( | _X | ) |
Definition at line 531 of file formatting.c.
| enum DCH_poz |
Definition at line 648 of file formatting.c.
| enum FormatNodeType |
| Enumerator | |
|---|---|
| NODE_TYPE_END | |
| NODE_TYPE_ACTION | |
| NODE_TYPE_CHAR | |
| NODE_TYPE_SEPARATOR | |
| NODE_TYPE_SPACE | |
Definition at line 155 of file formatting.c.
| enum FromCharDateMode |
| Enumerator | |
|---|---|
| FROM_CHAR_DATE_NONE | |
| FROM_CHAR_DATE_GREGORIAN | |
| FROM_CHAR_DATE_ISOWEEK | |
Definition at line 139 of file formatting.c.
| enum KeySuffixType |
| Enumerator | |
|---|---|
| SUFFTYPE_PREFIX | |
| SUFFTYPE_POSTFIX | |
Definition at line 119 of file formatting.c.
| enum NUM_poz |
Definition at line 767 of file formatting.c.
| enum NUMDesc_lsign |
| Enumerator | |
|---|---|
| NUM_LSIGN_PRE | |
| NUM_LSIGN_POST | |
| NUM_LSIGN_NONE | |
Definition at line 303 of file formatting.c.
| enum TH_Case |
| Enumerator | |
|---|---|
| TH_UPPER | |
| TH_LOWER | |
Definition at line 297 of file formatting.c.
|
static |
Definition at line 2076 of file formatting.c.
Referenced by DCH_from_char().
| char * asc_initcap | ( | const char * | buff, |
| size_t | nbytes | ||
| ) |
Definition at line 1931 of file formatting.c.
References pg_ascii_tolower(), pg_ascii_toupper(), and pnstrdup().
Referenced by str_initcap().
| char * asc_tolower | ( | const char * | buff, |
| size_t | nbytes | ||
| ) |
Definition at line 1887 of file formatting.c.
References pg_ascii_tolower(), and pnstrdup().
Referenced by asc_tolower_z(), str_casefold(), and str_tolower().
|
static |
Definition at line 1979 of file formatting.c.
References asc_tolower().
Referenced by DCH_to_char(), and NUM_processor().
| char * asc_toupper | ( | const char * | buff, |
| size_t | nbytes | ||
| ) |
Definition at line 1909 of file formatting.c.
References pg_ascii_toupper(), and pnstrdup().
Referenced by asc_toupper_z(), and str_toupper().
|
static |
Definition at line 1985 of file formatting.c.
References asc_toupper().
Referenced by DCH_to_char().
| bool datetime_format_has_tz | ( | const char * | fmt_str | ) |
Definition at line 4324 of file formatting.c.
References DCH_cache_fetch(), DCH_CACHE_SIZE, DCH_datetime_type(), DCH_FLAG, DCH_index, DCH_keywords, DCH_suff, DCH_ZONED, DCHCacheEntry::format, format, palloc(), parse_format(), and pfree().
Referenced by jspIsMutableWalker().
|
static |
Definition at line 3895 of file formatting.c.
References collid, cstring_to_text(), DCH_cache_fetch(), DCH_CACHE_SIZE, DCH_FLAG, DCH_index, DCH_keywords, DCH_MAX_ITEM_SIZ, DCH_suff, DCH_to_char(), DCHCacheEntry::format, format, palloc(), parse_format(), pfree(), and text_to_cstring().
Referenced by interval_to_char(), timestamp_to_char(), and timestamptz_to_char().
|
static |
Definition at line 3868 of file formatting.c.
References DCH_cache_getnew(), DCH_cache_search(), DCH_FLAG, DCH_index, DCH_keywords, DCH_suff, DCHCacheEntry::format, parse_format(), STD_FLAG, str, and DCHCacheEntry::valid.
Referenced by datetime_format_has_tz(), datetime_to_char_body(), and do_to_timestamp().
|
static |
Definition at line 3787 of file formatting.c.
References DCHCacheEntry::age, Assert(), DCH_CACHE_ENTRIES, DCH_CACHE_SIZE, DCH_prevent_counter_overflow(), DCHCache, DCHCounter, elog, i, MemoryContextAllocZero(), n_DCHCache, DCHCacheEntry::std, DCHCacheEntry::str, str, strlcpy(), TopMemoryContext, and DCHCacheEntry::valid.
Referenced by DCH_cache_fetch().
|
static |
Definition at line 3847 of file formatting.c.
References DCHCacheEntry::age, DCH_prevent_counter_overflow(), DCHCache, DCHCounter, i, n_DCHCache, DCHCacheEntry::std, DCHCacheEntry::str, str, and DCHCacheEntry::valid.
Referenced by DCH_cache_fetch().
|
static |
Definition at line 3691 of file formatting.c.
References DCH_A_D, DCH_a_d, DCH_A_M, DCH_a_m, DCH_AD, DCH_ad, DCH_AM, DCH_am, DCH_B_C, DCH_b_c, DCH_BC, DCH_bc, DCH_CC, DCH_D, DCH_DATED, DCH_DAY, DCH_Day, DCH_day, DCH_DD, DCH_DDD, DCH_DY, DCH_Dy, DCH_dy, DCH_FF1, DCH_FF2, DCH_FF3, DCH_FF4, DCH_FF5, DCH_FF6, DCH_FX, DCH_HH, DCH_HH12, DCH_HH24, DCH_I, DCH_ID, DCH_IDDD, DCH_IY, DCH_IYY, DCH_IYYY, DCH_J, DCH_MI, DCH_MM, DCH_MON, DCH_Mon, DCH_mon, DCH_MONTH, DCH_Month, DCH_month, DCH_MS, DCH_OF, DCH_P_M, DCH_p_m, DCH_PM, DCH_pm, DCH_Q, DCH_RM, DCH_rm, DCH_SS, DCH_SSSS, DCH_TIMED, DCH_TZ, DCH_tz, DCH_TZH, DCH_TZM, DCH_US, DCH_W, DCH_WW, DCH_Y, DCH_Y_YYY, DCH_YY, DCH_YYY, DCH_YYYY, DCH_ZONED, KeyWord::id, FormatNode::key, NODE_TYPE_ACTION, NODE_TYPE_END, and FormatNode::type.
Referenced by datetime_format_has_tz(), and do_to_timestamp().
|
static |
Definition at line 3121 of file formatting.c.
References TmFromChar::abbrev, adbc_strings, adbc_strings_long, adjust_partial_year_to_2020(), ampm_strings, ampm_strings_long, Assert(), TmFromChar::bc, cache_locale_time(), TmFromChar::cc, FormatNode::character, TmFromChar::clock_12_hour, collid, TmFromChar::d, KeyWord::date_mode, days, days_short, DCH_A_D, DCH_a_d, DCH_A_M, DCH_a_m, DCH_AD, DCH_ad, DCH_AM, DCH_am, DCH_B_C, DCH_b_c, DCH_BC, DCH_bc, DCH_CC, DCH_D, DCH_DAY, DCH_Day, DCH_day, DCH_DD, DCH_DDD, DCH_DY, DCH_Dy, DCH_dy, DCH_FF1, DCH_FF2, DCH_FF3, DCH_FF4, DCH_FF5, DCH_FF6, DCH_FX, DCH_HH, DCH_HH12, DCH_HH24, DCH_I, DCH_ID, DCH_IDDD, DCH_IW, DCH_IY, DCH_IYY, DCH_IYYY, DCH_J, DCH_MI, DCH_MM, DCH_MON, DCH_Mon, DCH_mon, DCH_MONTH, DCH_Month, DCH_month, DCH_MS, DCH_OF, DCH_P_M, DCH_p_m, DCH_PM, DCH_pm, DCH_Q, DCH_RM, DCH_rm, DCH_SS, DCH_SSSS, DCH_TZ, DCH_tz, DCH_TZH, DCH_TZM, DCH_US, DCH_W, DCH_WW, DCH_Y, DCH_Y_YYY, DCH_YY, DCH_YYY, DCH_YYYY, TmFromChar::dd, TmFromChar::ddd, DecodeTimezoneAbbrevPrefix(), ereturn, errcode(), errdetail(), errmsg(), TmFromChar::ff, from_char_parse_int(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), TmFromChar::gmtoffset, TmFromChar::has_tz, TmFromChar::hh, KeyWord::id, InvalidOid, is_separator_char(), IS_SUFFIX_TM(), TmFromChar::j, FormatNode::key, len, localized_abbrev_days, localized_abbrev_months, localized_full_days, localized_full_months, TmFromChar::mi, TmFromChar::mm, months, months_full, MONTHS_PER_YEAR, TmFromChar::ms, KeyWord::name, NODE_TYPE_ACTION, NODE_TYPE_CHAR, NODE_TYPE_END, NODE_TYPE_SEPARATOR, NODE_TYPE_SPACE, pg_add_s32_overflow(), pg_mblen(), pg_mul_s32_overflow(), TmFromChar::pm, pnstrdup(), rm_months_lower, SKIP_THth, TmFromChar::ss, TmFromChar::ssss, FormatNode::suffix, FormatNode::type, TmFromChar::tzh, TmFromChar::tzm, TmFromChar::tzp, TmFromChar::tzsign, TmFromChar::us, value, TmFromChar::w, TmFromChar::ww, TmFromChar::year, and TmFromChar::yysz.
Referenced by do_to_timestamp().
|
inlinestatic |
Definition at line 3677 of file formatting.c.
References DCHCache, DCHCounter, i, and n_DCHCache.
Referenced by DCH_cache_getnew(), and DCH_cache_search().
|
static |
Definition at line 2475 of file formatting.c.
References A_D_STR, a_d_STR, A_M_STR, a_m_STR, AD_STR, ad_STR, ADJUST_YEAR, AM_STR, am_STR, asc_tolower_z(), asc_toupper_z(), B_C_STR, b_c_STR, BC_STR, bc_STR, cache_locale_time(), FormatNode::character, collid, date2isoweek(), date2isoyear(), date2isoyearday(), date2j(), days, days_short, DCH_A_D, DCH_a_d, DCH_A_M, DCH_a_m, DCH_AD, DCH_ad, DCH_AM, DCH_am, DCH_B_C, DCH_b_c, DCH_BC, DCH_bc, DCH_CC, DCH_D, DCH_DAY, DCH_Day, DCH_day, DCH_DD, DCH_DDD, DCH_DY, DCH_Dy, DCH_dy, DCH_FF1, DCH_FF2, DCH_FF3, DCH_FF4, DCH_FF5, DCH_FF6, DCH_HH, DCH_HH12, DCH_HH24, DCH_I, DCH_ID, DCH_IDDD, DCH_IW, DCH_IY, DCH_IYY, DCH_IYYY, DCH_J, DCH_MAX_ITEM_SIZ, DCH_MI, DCH_MM, DCH_MON, DCH_Mon, DCH_mon, DCH_MONTH, DCH_Month, DCH_month, DCH_MS, DCH_OF, DCH_P_M, DCH_p_m, DCH_PM, DCH_pm, DCH_Q, DCH_RM, DCH_rm, DCH_SS, DCH_SSSS, DCH_to_char_fsec, DCH_TZ, DCH_tz, DCH_TZH, DCH_TZM, DCH_US, DCH_W, DCH_WW, DCH_Y, DCH_Y_YYY, DCH_YY, DCH_YYY, DCH_YYYY, ereport, errcode(), errmsg(), ERROR, TmToChar::fsec, HOURS_PER_DAY, i, KeyWord::id, INVALID_FOR_INTERVAL, IS_SUFFIX_FM(), IS_SUFFIX_THth(), IS_SUFFIX_TM(), FormatNode::key, KeyWord::len, localized_abbrev_days, localized_abbrev_months, localized_full_days, localized_full_months, months, months_full, MONTHS_PER_YEAR, NODE_TYPE_ACTION, NODE_TYPE_END, P_M_STR, p_m_STR, pfree(), PM_STR, pm_STR, rm_months_lower, rm_months_upper, SECS_PER_HOUR, SECS_PER_MINUTE, sprintf, str, str_initcap_z(), str_numth(), str_tolower_z(), str_toupper_z(), FormatNode::suffix, SUFFIX_TH_TYPE(), TmToChar::tm, tm, pg_tm::tm_gmtoff, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, TM_SUFFIX_LEN, pg_tm::tm_wday, pg_tm::tm_yday, pg_tm::tm_year, tmtcTzn, and FormatNode::type.
Referenced by datetime_to_char_body().
|
static |
Definition at line 4387 of file formatting.c.
References TmFromChar::abbrev, Assert(), TmFromChar::bc, TmFromChar::cc, TmFromChar::clock_12_hour, collid, TmFromChar::d, DateTimeParseError(), DAY, DCH_cache_fetch(), DCH_CACHE_SIZE, DCH_datetime_type(), DCH_FLAG, DCH_from_char(), DCH_index, DCH_keywords, DCH_suff, TmFromChar::dd, TmFromChar::ddd, DEBUG_TM, DEBUG_TMFC, DetermineTimeZoneAbbrevOffset(), DTERR_FIELD_OVERFLOW, DTERR_TZDISP_OVERFLOW, DTK_DATE_M, DTK_M, errcode(), errhint(), errmsg(), errsave, TmFromChar::ff, DCHCacheEntry::format, format, FROM_CHAR_DATE_ISOWEEK, TmFromChar::gmtoffset, fmt_tz::gmtoffset, TmFromChar::has_tz, fmt_tz::has_tz, TmFromChar::hh, HOURS_PER_DAY, i, INT64CONST, isleap, isoweek2date(), isoweek2j(), isoweekdate2date(), TmFromChar::j, j2date(), MAX_TZDISP_HOUR, TmFromChar::mi, MINS_PER_HOUR, TmFromChar::mm, TmFromChar::mode, MONTH, MONTHS_PER_YEAR, TmFromChar::ms, palloc(), parse_format(), pfree(), pg_add_s32_overflow(), pg_mul_s32_overflow(), pg_sub_s32_overflow(), TmFromChar::pm, SECS_PER_HOUR, SECS_PER_MINUTE, SOFT_ERROR_OCCURRED, TmFromChar::ss, TmFromChar::ssss, STD_FLAG, text_to_cstring(), tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, TmFromChar::tzh, TmFromChar::tzm, TmFromChar::tzp, TmFromChar::tzsign, TmFromChar::us, USECS_PER_SEC, ValidateDate(), VARSIZE_ANY_EXHDR(), TmFromChar::w, TmFromChar::ww, x, y, TmFromChar::year, YEAR, TmFromChar::yysz, and ZERO_tm.
Referenced by parse_datetime(), to_date(), and to_timestamp().
|
static |
Definition at line 4822 of file formatting.c.
References str.
Referenced by float4_to_char(), float8_to_char(), int4_to_char(), int8_to_char(), int_to_roman(), and numeric_to_char().
| Datum float4_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6631 of file formatting.c.
References fill_str(), FLOAT4_FITS_IN_INT32, format, int_to_roman(), IS_EEEE, IS_MULTI, IS_ROMAN, NUMDesc::multi, NUM_TOCHAR_finish, NUM_TOCHAR_prepare, palloc(), PG_GETARG_FLOAT4, PG_GETARG_TEXT_PP, PG_INT32_MAX, PG_RETURN_TEXT_P, NUMDesc::post, NUMDesc::pre, psprintf(), sign, val, and value.
| Datum float8_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6743 of file formatting.c.
References fill_str(), FLOAT8_FITS_IN_INT32, format, int_to_roman(), IS_EEEE, IS_MULTI, IS_ROMAN, NUMDesc::multi, NUM_TOCHAR_finish, NUM_TOCHAR_prepare, palloc(), PG_GETARG_FLOAT8, PG_GETARG_TEXT_PP, PG_INT32_MAX, PG_RETURN_TEXT_P, NUMDesc::post, NUMDesc::pre, psprintf(), sign, val, and value.
|
static |
Definition at line 2278 of file formatting.c.
References generate_unaccent_rules::dest, from_char_parse_int_len(), FormatNode::key, and KeyWord::len.
Referenced by DCH_from_char().
|
static |
Definition at line 2183 of file formatting.c.
References Assert(), DCH_MAX_ITEM_SIZ, generate_unaccent_rules::dest, ereturn, errcode(), errdetail(), errhint(), errmsg(), from_char_set_int(), init, is_next_separator(), IS_SUFFIX_FM(), FormatNode::key, len, KeyWord::name, strlcpy(), strspace_len(), and FormatNode::suffix.
Referenced by DCH_from_char(), and from_char_parse_int().
|
static |
Definition at line 2432 of file formatting.c.
References collid, generate_unaccent_rules::dest, ereturn, errcode(), errdetail(), errmsg(), FormatNode::key, len, KeyWord::name, pstrdup(), scanner_isspace(), seq_search_ascii(), and seq_search_localized().
Referenced by DCH_from_char().
|
static |
Definition at line 2148 of file formatting.c.
References generate_unaccent_rules::dest, ereturn, errcode(), errdetail(), errmsg(), FormatNode::key, KeyWord::name, and value.
Referenced by DCH_from_char(), and from_char_parse_int_len().
|
static |
Definition at line 2122 of file formatting.c.
References ereturn, errcode(), errhint(), errmsg(), FROM_CHAR_DATE_NONE, TmFromChar::mode, and mode.
Referenced by DCH_from_char().
|
static |
Definition at line 5301 of file formatting.c.
References elog.
Referenced by NUM_processor().
|
static |
Definition at line 1562 of file formatting.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, len, numTH, numth, TH_UPPER, and type.
Referenced by NUM_processor(), and str_numth().
|
static |
Definition at line 1141 of file formatting.c.
References KeyWord_INDEX_FILTER, KeyWord::len, KeyWord::name, and str.
Referenced by parse_format().
| Datum int4_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6427 of file formatting.c.
References DatumGetCString(), DirectFunctionCall1, fill_str(), format, Int32GetDatum(), int4out(), int_to_roman(), IS_EEEE, IS_MULTI, IS_ROMAN, NUMDesc::multi, NUM_TOCHAR_finish, NUM_TOCHAR_prepare, palloc(), PG_GETARG_INT32, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, NUMDesc::post, NUMDesc::pre, psprintf(), sign, val, and value.
| Datum int8_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6520 of file formatting.c.
References DatumGetCString(), DatumGetInt64(), DirectFunctionCall1, DirectFunctionCall2, dtoi8(), fill_str(), Float8GetDatum(), format, int64_to_numeric(), Int64GetDatum(), int8mul(), int8out(), int_to_roman(), IS_EEEE, IS_MULTI, IS_ROMAN, NUMDesc::multi, NUM_TOCHAR_finish, NUM_TOCHAR_prepare, numeric_out_sci(), palloc(), PG_GETARG_INT64, PG_GETARG_TEXT_PP, PG_INT32_MAX, PG_INT32_MIN, PG_RETURN_TEXT_P, NUMDesc::post, NUMDesc::pre, sign, and value.
|
static |
Definition at line 5012 of file formatting.c.
References Assert(), fill_str(), len, MAX_ROMAN_LEN, palloc(), rm1, rm10, rm100, and snprintf.
Referenced by float4_to_char(), float8_to_char(), int4_to_char(), int8_to_char(), and numeric_to_char().
| Datum interval_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4038 of file formatting.c.
References datetime_to_char_body(), DAYS_PER_MONTH, TmToChar::fsec, if(), interval2itm(), INTERVAL_NOT_FINITE, MONTHS_PER_YEAR, PG_GET_COLLATION, PG_GETARG_INTERVAL_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, tm, pg_itm::tm_hour, pg_tm::tm_hour, pg_itm::tm_mday, pg_tm::tm_mday, pg_itm::tm_min, pg_tm::tm_min, pg_itm::tm_mon, pg_tm::tm_mon, pg_itm::tm_sec, pg_tm::tm_sec, pg_itm::tm_usec, pg_tm::tm_yday, pg_itm::tm_year, pg_tm::tm_year, tmtcTm, VARSIZE_ANY_EXHDR(), and ZERO_tmtc.
|
static |
Definition at line 2043 of file formatting.c.
References FormatNode::character, KeyWord::is_digit, IS_SUFFIX_THth(), FormatNode::key, NODE_TYPE_ACTION, NODE_TYPE_END, FormatNode::suffix, and FormatNode::type.
Referenced by from_char_parse_int_len().
|
static |
Definition at line 1179 of file formatting.c.
References str.
Referenced by DCH_from_char(), and parse_format().
|
inlinestatic |
Definition at line 593 of file formatting.c.
References DCH_SUFFIX_FM.
Referenced by DCH_to_char(), and from_char_parse_int_len().
|
inlinestatic |
Definition at line 568 of file formatting.c.
References DCH_SUFFIX_TH.
Referenced by IS_SUFFIX_THth().
|
inlinestatic |
Definition at line 574 of file formatting.c.
References DCH_SUFFIX_th.
Referenced by IS_SUFFIX_THth().
|
inlinestatic |
Definition at line 580 of file formatting.c.
References IS_SUFFIX_TH(), and IS_SUFFIX_th().
Referenced by DCH_to_char(), and is_next_separator().
|
inlinestatic |
Definition at line 599 of file formatting.c.
References DCH_SUFFIX_TM.
Referenced by DCH_from_char(), and DCH_to_char().
|
static |
Definition at line 4949 of file formatting.c.
References NUMDesc::flag, NUMCacheEntry::format, format, len, NUMDesc::lsign, NUMDesc::multi, NUMDesc::need_locale, NUMCacheEntry::Num, NUM_cache_fetch(), NUM_CACHE_SIZE, NUM_FLAG, NUM_index, NUM_keywords, palloc(), parse_format(), pfree(), NUMDesc::post, NUMDesc::pre, NUMDesc::pre_lsign_num, str, text_to_cstring(), NUMDesc::zero_end, and NUMDesc::zero_start.
Referenced by numeric_to_number().
|
static |
Definition at line 4922 of file formatting.c.
References NUMCacheEntry::format, NUMCacheEntry::Num, NUM_cache_getnew(), NUM_cache_search(), NUM_FLAG, NUM_index, NUM_keywords, parse_format(), str, and NUMCacheEntry::valid.
Referenced by NUM_cache().
|
static |
Definition at line 4842 of file formatting.c.
References NUMCacheEntry::age, Assert(), elog, i, MemoryContextAllocZero(), n_NUMCache, NUM_CACHE_ENTRIES, NUM_CACHE_SIZE, NUM_prevent_counter_overflow(), NUMCache, NUMCounter, NUMCacheEntry::str, str, strlcpy(), TopMemoryContext, and NUMCacheEntry::valid.
Referenced by NUM_cache_fetch().
|
static |
Definition at line 4901 of file formatting.c.
References NUMCacheEntry::age, i, n_NUMCache, NUM_prevent_counter_overflow(), NUMCache, NUMCounter, NUMCacheEntry::str, str, and NUMCacheEntry::valid.
Referenced by NUM_cache_fetch().
|
static |
Definition at line 5732 of file formatting.c.
References NUMProc::inout_p, OVERLOAD_TEST, and pg_mblen().
Referenced by NUM_processor().
|
static |
Definition at line 5328 of file formatting.c.
References AMOUNT_TEST, NUMProc::decimal, elog, NUMProc::inout, NUMProc::inout_p, IS_BRACKET, IS_DECIMAL, IS_LSIGN, IS_MINUS, IS_PLUS, NUMProc::L_negative_sign, NUMProc::L_positive_sign, NUMDesc::lsign, NUMProc::Num, NUM_0, NUM_9, NUM_DEC, NUM_LSIGN_PRE, NUMProc::number, NUMProc::number_p, OVERLOAD_TEST, NUMDesc::post, NUMProc::read_dec, NUMProc::read_post, NUMProc::read_pre, and x.
Referenced by NUM_processor().
|
static |
Definition at line 5542 of file formatting.c.
References NUMProc::decimal, elog, NUMProc::inout, NUMProc::inout_p, IS_BRACKET, IS_DECIMAL, IS_FILLMODE, IS_LSIGN, IS_PREDEC_SPACE, IS_ROMAN, IS_ZERO, NUMProc::L_negative_sign, NUMProc::L_positive_sign, NUMProc::last_relevant, NUMDesc::lsign, NUMProc::Num, NUM_0, NUM_9, NUMProc::num_count, NUMProc::num_curr, NUM_D, NUM_DEC, NUMProc::num_in, NUM_LSIGN_POST, NUM_LSIGN_PRE, NUMProc::number_p, NUMProc::out_pre_spaces, NUMProc::sign, NUMProc::sign_wrote, and NUMDesc::zero_start.
Referenced by NUM_processor().
|
static |
Definition at line 5220 of file formatting.c.
References NUMProc::decimal, IS_LDECIMAL, NUMProc::L_currency_symbol, NUMProc::L_negative_sign, NUMProc::L_positive_sign, NUMProc::L_thousands_sep, NUMDesc::need_locale, NUMProc::Num, and PGLC_localeconv().
Referenced by NUM_processor().
|
inlinestatic |
Definition at line 4830 of file formatting.c.
References i, n_NUMCache, NUMCache, and NUMCounter.
Referenced by NUM_cache_getnew(), and NUM_cache_search().
|
static |
Definition at line 5745 of file formatting.c.
References AMOUNT_TEST, asc_tolower_z(), FormatNode::character, elog, ereport, errcode(), errmsg(), ERROR, NUMDesc::flag, get_last_relevant_decnum(), get_th(), KeyWord::id, NUMProc::inout, NUMProc::inout_p, IS_BRACKET, IS_DECIMAL, IS_EEEE, IS_FILLMODE, IS_LSIGN, IS_MINUS, IS_PLUS, IS_ROMAN, NUMProc::is_to_char, IS_ZERO, FormatNode::key, NUMProc::L_currency_symbol, NUMProc::L_thousands_sep, NUMProc::last_relevant, NUMDesc::lsign, MemSet, Min, NODE_TYPE_ACTION, NODE_TYPE_END, NUMProc::Num, NUM_0, NUM_9, NUM_COMMA, NUMProc::num_count, NUMProc::num_curr, NUM_D, NUM_DEC, NUM_eat_non_data_chars(), NUM_G, NUMProc::num_in, NUM_L, NUM_LSIGN_POST, NUM_LSIGN_PRE, NUM_MI, NUM_numpart_from_char(), NUM_numpart_to_char(), NUM_PL, NUM_prepare_locale(), NUM_RN, NUM_rn, NUM_SG, NUM_TH, NUM_th, NUMProc::number, NUMProc::number_p, NUMProc::out_pre_spaces, OVERLOAD_TEST, pg_mblen(), pg_mbstrlen(), NUMDesc::post, NUMDesc::pre, NUMDesc::pre_lsign_num, NUMProc::read_dec, NUMProc::read_post, NUMProc::read_pre, roman_to_int(), NUMProc::sign, sign, NUMProc::sign_wrote, sprintf, TH_LOWER, TH_UPPER, FormatNode::type, NUMDesc::zero_end, and NUMDesc::zero_start.
Referenced by numeric_to_number().
|
static |
Definition at line 1192 of file formatting.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, NUMDesc::flag, KeyWord::id, IS_BLANK, IS_BRACKET, IS_DECIMAL, IS_EEEE, IS_FILLMODE, IS_LSIGN, IS_MINUS, IS_MULTI, IS_PLUS, IS_ROMAN, IS_ZERO, FormatNode::key, NUMDesc::lsign, NUMDesc::multi, NUMDesc::need_locale, NODE_TYPE_ACTION, NUM_0, NUM_9, NUM_B, NUM_D, NUM_DEC, NUM_E, NUM_F_BLANK, NUM_F_BRACKET, NUM_F_DECIMAL, NUM_F_EEEE, NUM_F_FILLMODE, NUM_F_LDECIMAL, NUM_F_LSIGN, NUM_F_MINUS, NUM_F_MINUS_POST, NUM_F_MULTI, NUM_F_PLUS, NUM_F_PLUS_POST, NUM_F_ROMAN, NUM_F_ZERO, NUM_FM, NUM_G, NUM_L, NUM_LSIGN_NONE, NUM_LSIGN_POST, NUM_LSIGN_PRE, NUM_MI, NUM_PL, NUM_PR, NUM_RN, NUM_rn, NUM_S, NUM_SG, NUM_V, NUMDesc::post, NUMDesc::pre, NUMDesc::pre_lsign_num, FormatNode::type, NUMDesc::zero_end, and NUMDesc::zero_start.
Referenced by parse_format().
| Datum numeric_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6300 of file formatting.c.
References a, b, DatumGetCString(), DatumGetNumeric(), DirectFunctionCall1, DirectFunctionCall2, ErrorSaveContext::error_occurred, fill_str(), format, Int32GetDatum(), int64_to_numeric(), int_to_roman(), IS_EEEE, IS_MULTI, IS_ROMAN, NUMDesc::multi, NUM_TOCHAR_finish, NUM_TOCHAR_prepare, numeric_int4_safe(), numeric_mul(), numeric_out(), numeric_out_sci(), numeric_power(), numeric_round(), NumericGetDatum(), palloc(), PG_GETARG_NUMERIC, PG_GETARG_TEXT_PP, PG_INT32_MAX, PG_RETURN_TEXT_P, NUMDesc::post, NUMDesc::pre, sign, val, value, and x.
| Datum numeric_to_number | ( | PG_FUNCTION_ARGS | ) |
Definition at line 6242 of file formatting.c.
References a, b, CStringGetDatum(), DatumGetNumeric(), DirectFunctionCall2, DirectFunctionCall3, format, Int32GetDatum(), int64_to_numeric(), InvalidOid, IS_MULTI, len, NUMDesc::multi, NUM_cache(), NUM_MAX_ITEM_SIZ, NUM_processor(), numeric_in(), numeric_mul(), numeric_power(), NumericGetDatum(), ObjectIdGetDatum(), palloc(), pfree(), PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_NULL, NUMDesc::post, NUMDesc::pre, scale, value, VARDATA_ANY(), VARHDRSZ, VARSIZE_ANY_EXHDR(), and x.
| Datum parse_datetime | ( | text * | date_txt, |
| text * | fmt, | ||
| Oid | collid, | ||
| bool | strict, | ||
| Oid * | typid, | ||
| int32 * | typmod, | ||
| int * | tz, | ||
| Node * | escontext | ||
| ) |
Definition at line 4163 of file formatting.c.
References AdjustTimeForTypmod(), AdjustTimestampForTypmod(), Assert(), collid, date2j(), DateADTGetDatum(), DCH_DATED, DCH_TIMED, DCH_ZONED, do_to_timestamp(), ereturn, errcode(), errmsg(), fmt_tz::gmtoffset, fmt_tz::has_tz, IS_VALID_DATE, IS_VALID_JULIAN, palloc(), POSTGRES_EPOCH_JDATE, text_to_cstring(), TimeTzADT::time, TimeADTGetDatum(), TimestampGetDatum(), TimestampTzGetDatum(), TimeTzADTPGetDatum(), tm, tm2time(), tm2timestamp(), tm2timetz(), pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by executeDateTimeMethod().
|
static |
Definition at line 1377 of file formatting.c.
References FormatNode::character, DCH_FLAG, elog, ereport, errcode(), errmsg(), ERROR, KeySuffix::id, index_seq_search(), is_separator_char(), FormatNode::key, KeySuffix::len, KeyWord::len, NODE_TYPE_ACTION, NODE_TYPE_CHAR, NODE_TYPE_END, NODE_TYPE_SEPARATOR, NODE_TYPE_SPACE, NUM_FLAG, NUMDesc_prepare(), pg_mblen(), pnstrdup(), STD_FLAG, str, suff_search(), FormatNode::suffix, SUFFTYPE_POSTFIX, SUFFTYPE_PREFIX, and FormatNode::type.
Referenced by datetime_format_has_tz(), datetime_to_char_body(), DCH_cache_fetch(), do_to_timestamp(), NUM_cache(), and NUM_cache_fetch().
|
static |
Definition at line 5071 of file formatting.c.
References i, NUMProc::inout_p, IS_VALID_SUB_COMB, len, MAX_ROMAN_LEN, OVERLOAD_TEST, pg_ascii_toupper(), and ROMAN_VAL.
Referenced by NUM_processor().
|
static |
Definition at line 2296 of file formatting.c.
References a, len, name, and pg_ascii_tolower().
Referenced by from_char_seq_search().
|
static |
Definition at line 2349 of file formatting.c.
References a, collid, len, name, pfree(), str_tolower(), and str_toupper().
Referenced by from_char_seq_search().
| char * str_casefold | ( | const char * | buff, |
| size_t | nbytes, | ||
| Oid | collid | ||
| ) |
Definition at line 1818 of file formatting.c.
References asc_tolower(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, GetDatabaseEncoding(), OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strfold(), PG_UTF8, and repalloc().
Referenced by casefold().
| char * str_initcap | ( | const char * | buff, |
| size_t | nbytes, | ||
| Oid | collid | ||
| ) |
Definition at line 1754 of file formatting.c.
References asc_initcap(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strtitle(), and repalloc().
Referenced by initcap(), and str_initcap_z().
|
static |
Definition at line 1973 of file formatting.c.
References collid, and str_initcap().
Referenced by DCH_to_char().
|
static |
Definition at line 1607 of file formatting.c.
References generate_unaccent_rules::dest, get_th(), and type.
Referenced by DCH_to_char().
| char * str_tolower | ( | const char * | buff, |
| size_t | nbytes, | ||
| Oid | collid | ||
| ) |
Definition at line 1626 of file formatting.c.
References asc_tolower(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strlower(), and repalloc().
Referenced by citext_eq(), citext_hash(), citext_hash_extended(), citext_ne(), citextcmp(), convertPgWchar(), dispell_init(), dispell_lexize(), dsimple_init(), dsimple_lexize(), dsnowball_init(), dsnowball_lexize(), dsynonym_init(), dsynonym_lexize(), dxsyn_lexize(), generate_trgm_only(), generate_wildcard_trgm(), internal_citext_pattern_cmp(), lower(), lowerstr_ctx(), ltree_strncasecmp(), NIImportAffixes(), read_dictionary(), seq_search_localized(), and str_tolower_z().
|
static |
Definition at line 1961 of file formatting.c.
References collid, and str_tolower().
Referenced by DCH_to_char().
| char * str_toupper | ( | const char * | buff, |
| size_t | nbytes, | ||
| Oid | collid | ||
| ) |
Definition at line 1690 of file formatting.c.
References asc_toupper(), Assert(), collid, pg_locale_struct::ctype_is_c, ereport, errcode(), errhint(), errmsg(), ERROR, OidIsValid, palloc(), pg_newlocale_from_collation(), pg_strupper(), and repalloc().
Referenced by seq_search_localized(), str_toupper_z(), and upper().
|
static |
Definition at line 1967 of file formatting.c.
References collid, and str_toupper().
Referenced by DCH_to_char().
|
static |
|
static |
Definition at line 1165 of file formatting.c.
References KeySuffix::name, str, and type.
Referenced by parse_format().
Definition at line 586 of file formatting.c.
References DCH_SUFFIX_TH, TH_LOWER, and TH_UPPER.
Referenced by DCH_to_char().
| Datum timestamp_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3963 of file formatting.c.
References COPY_tm, date2j(), datetime_to_char_body(), ereport, errcode(), errmsg(), ERROR, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_GETARG_TIMESTAMP, PG_RETURN_NULL, PG_RETURN_TEXT_P, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_wday, pg_tm::tm_yday, pg_tm::tm_year, tmtcFsec, tmtcTm, VARSIZE_ANY_EXHDR(), and ZERO_tmtc.
| Datum timestamptz_to_char | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3998 of file formatting.c.
References COPY_tm, date2j(), datetime_to_char_body(), ereport, errcode(), errmsg(), ERROR, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_GETARG_TIMESTAMP, PG_RETURN_NULL, PG_RETURN_TEXT_P, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_wday, pg_tm::tm_yday, pg_tm::tm_year, tmtcFsec, tmtcTm, tmtcTzn, VARSIZE_ANY_EXHDR(), and ZERO_tmtc.
| Datum to_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4117 of file formatting.c.
References collid, date2j(), do_to_timestamp(), ereport, errcode(), errmsg(), ERROR, IS_VALID_DATE, IS_VALID_JULIAN, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_DATEADT, POSTGRES_EPOCH_JDATE, text_to_cstring(), tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
| Datum to_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4079 of file formatting.c.
References AdjustTimestampForTypmod(), collid, DetermineTimeZoneOffset(), do_to_timestamp(), ereport, errcode(), errmsg(), ERROR, fmt_tz::gmtoffset, fmt_tz::has_tz, PG_GET_COLLATION, PG_GETARG_TEXT_PP, PG_RETURN_TIMESTAMP, session_timezone, tm, and tm2timestamp().
Definition at line 215 of file formatting.c.
Referenced by DCH_from_char().
Definition at line 216 of file formatting.c.
Referenced by DCH_from_char().
Definition at line 241 of file formatting.c.
Referenced by DCH_from_char().
Definition at line 242 of file formatting.c.
Referenced by DCH_from_char().
|
static |
Definition at line 182 of file formatting.c.
Referenced by DCH_from_char(), and DCH_to_char().
|
static |
Definition at line 984 of file formatting.c.
Referenced by datetime_format_has_tz(), datetime_to_char_body(), DCH_cache_fetch(), and do_to_timestamp().
|
static |
Definition at line 813 of file formatting.c.
Referenced by datetime_format_has_tz(), datetime_to_char_body(), DCH_cache_fetch(), and do_to_timestamp().
|
static |
Definition at line 609 of file formatting.c.
Referenced by datetime_format_has_tz(), datetime_to_char_body(), DCH_cache_fetch(), and do_to_timestamp().
|
static |
Definition at line 409 of file formatting.c.
Referenced by DCH_cache_getnew(), DCH_cache_search(), and DCH_prevent_counter_overflow().
|
static |
Definition at line 411 of file formatting.c.
Referenced by DCH_cache_getnew(), DCH_cache_search(), and DCH_prevent_counter_overflow().
|
static |
Definition at line 177 of file formatting.c.
Referenced by DCH_from_char(), and DCH_to_char().
|
static |
Definition at line 410 of file formatting.c.
Referenced by DCH_cache_getnew(), DCH_cache_search(), and DCH_prevent_counter_overflow().
|
static |
Definition at line 415 of file formatting.c.
Referenced by NUM_cache_getnew(), NUM_cache_search(), and NUM_prevent_counter_overflow().
|
static |
Definition at line 1007 of file formatting.c.
Referenced by NUM_cache(), and NUM_cache_fetch().
|
static |
Definition at line 937 of file formatting.c.
Referenced by NUM_cache(), and NUM_cache_fetch().
|
static |
Definition at line 414 of file formatting.c.
Referenced by NUM_cache_getnew(), NUM_cache_search(), and NUM_prevent_counter_overflow().
|
static |
Definition at line 416 of file formatting.c.
Referenced by NUM_cache_getnew(), NUM_cache_search(), and NUM_prevent_counter_overflow().
|
static |
Definition at line 291 of file formatting.c.
Referenced by get_th().
|
static |
Definition at line 292 of file formatting.c.
Referenced by get_th().
|
static |
Definition at line 258 of file formatting.c.
Referenced by int_to_roman().
|
static |
Definition at line 259 of file formatting.c.
Referenced by int_to_roman().
|
static |
Definition at line 260 of file formatting.c.
Referenced by int_to_roman().
|
static |
Definition at line 252 of file formatting.c.
Referenced by DCH_from_char(), and DCH_to_char().
|
static |
Definition at line 249 of file formatting.c.
Referenced by DCH_to_char().