PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <time.h>
#include "access/xact.h"
#include "common/hashfn.h"
#include "libpq/pqformat.h"
#include "miscadmin.h"
#include "nodes/supportnodes.h"
#include "parser/scansup.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/date.h"
#include "utils/datetime.h"
#include "utils/numeric.h"
#include "utils/sortsupport.h"
Go to the source code of this file.
Macros | |
#define | TIMEADT_GT(t1, t2) (DatumGetTimeADT(t1) > DatumGetTimeADT(t2)) |
#define | TIMEADT_LT(t1, t2) (DatumGetTimeADT(t1) < DatumGetTimeADT(t2)) |
#define | TIMETZ_GT(t1, t2) DatumGetBool(DirectFunctionCall2(timetz_gt,t1,t2)) |
#define | TIMETZ_LT(t1, t2) DatumGetBool(DirectFunctionCall2(timetz_lt,t1,t2)) |
#define TIMEADT_GT | ( | t1, | |
t2 | |||
) | (DatumGetTimeADT(t1) > DatumGetTimeADT(t2)) |
Referenced by overlaps_time().
#define TIMEADT_LT | ( | t1, | |
t2 | |||
) | (DatumGetTimeADT(t1) < DatumGetTimeADT(t2)) |
Referenced by overlaps_time().
#define TIMETZ_GT | ( | t1, | |
t2 | |||
) | DatumGetBool(DirectFunctionCall2(timetz_gt,t1,t2)) |
Referenced by overlaps_timetz().
#define TIMETZ_LT | ( | t1, | |
t2 | |||
) | DatumGetBool(DirectFunctionCall2(timetz_lt,t1,t2)) |
Referenced by overlaps_timetz().
Definition at line 1646 of file date.c.
References MAX_TIME_PRECISION.
Referenced by GetSQLCurrentTime(), GetSQLLocalTime(), parse_datetime(), time_in(), time_recv(), time_scale(), timetz_in(), timetz_recv(), and timetz_scale().
Definition at line 69 of file date.c.
References ereport, errcode(), errmsg(), ERROR, MAX_TIME_PRECISION, and WARNING.
Referenced by anytime_typmodin(), and transformSQLValueFunction().
Definition at line 48 of file date.c.
References anytime_typmod_check(), ArrayGetIntegerTypmods(), ereport, errcode(), errmsg(), and ERROR.
Referenced by timetypmodin(), and timetztypmodin().
Definition at line 91 of file date.c.
References psprintf().
Referenced by timetypmodout(), and timetztypmodout().
|
static |
Definition at line 613 of file date.c.
References date2timestamp_opt_overflow().
Referenced by date_mi_interval(), date_pl_interval(), date_timestamp(), datetime_timestamp(), and in_range_date_interval().
double date2timestamp_no_overflow | ( | DateADT | dateVal | ) |
Definition at line 725 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, and USECS_PER_DAY.
Referenced by convert_timevalue_to_scalar().
Definition at line 569 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, ereport, errcode(), errmsg(), ERROR, POSTGRES_EPOCH_JDATE, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, and USECS_PER_DAY.
Referenced by date2timestamp(), and date_cmp_timestamp_internal().
|
static |
Definition at line 709 of file date.c.
References date2timestamptz_opt_overflow().
Referenced by date_timestamptz().
TimestampTz date2timestamptz_opt_overflow | ( | DateADT | dateVal, |
int * | overflow | ||
) |
Definition at line 629 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, DetermineTimeZoneOffset(), ereport, errcode(), errmsg(), ERROR, IS_VALID_TIMESTAMP, j2date(), MIN_TIMESTAMP, POSTGRES_EPOCH_JDATE, session_timezone, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, 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, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by date2timestamptz(), and date_cmp_timestamptz_internal().
Datum date_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 429 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_INT32.
Referenced by compareDatetime(), gbt_datekey_cmp(), and leftmostvalue_date().
Datum date_cmp_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 819 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_INT32.
Definition at line 748 of file date.c.
References Assert, date2timestamp_opt_overflow(), timestamp_cmp_internal(), and TIMESTAMP_IS_NOEND.
Referenced by cmpDateToTimestamp(), date_cmp_timestamp(), date_eq_timestamp(), date_ge_timestamp(), date_gt_timestamp(), date_le_timestamp(), date_lt_timestamp(), date_ne_timestamp(), timestamp_cmp_date(), timestamp_eq_date(), timestamp_ge_date(), timestamp_gt_date(), timestamp_le_date(), timestamp_lt_date(), and timestamp_ne_date().
Datum date_cmp_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 903 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_INT32.
int32 date_cmp_timestamptz_internal | ( | DateADT | dateVal, |
TimestampTz | dt2 | ||
) |
Definition at line 828 of file date.c.
References date2timestamptz_opt_overflow(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, and timestamptz_cmp_internal.
Referenced by cmpDateToTimestampTz(), date_cmp_timestamptz(), date_eq_timestamptz(), date_ge_timestamptz(), date_gt_timestamptz(), date_le_timestamptz(), date_lt_timestamptz(), date_ne_timestamptz(), timestamptz_cmp_date(), timestamptz_eq_date(), timestamptz_ge_date(), timestamptz_gt_date(), timestamptz_le_date(), timestamptz_lt_date(), and timestamptz_ne_date().
Datum date_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 375 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Referenced by gbt_dateeq().
Datum date_eq_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 765 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_eq_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 849 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
|
static |
Definition at line 442 of file date.c.
References DatumGetDateADT.
Referenced by date_sortsupport().
Datum date_finite | ( | PG_FUNCTION_ARGS | ) |
Definition at line 464 of file date.c.
References DATE_NOT_FINITE, PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Datum date_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 420 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Referenced by gbt_datege().
Datum date_ge_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 810 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_ge_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 894 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum date_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 411 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Referenced by gbt_dategt().
Datum date_gt_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 792 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_gt_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 876 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum date_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 111 of file date.c.
References date2j(), DATE_NOBEGIN, DATE_NOEND, DateTimeParseError(), DecodeDateTime(), DTERR_BAD_FORMAT, DTK_DATE, DTK_EARLY, DTK_EPOCH, DTK_LATE, ereport, errcode(), errmsg(), ERROR, GetEpochTime(), IS_VALID_DATE, IS_VALID_JULIAN, MAXDATEFIELDS, MAXDATELEN, ParseDateTime(), PG_GETARG_CSTRING, PG_RETURN_DATEADT, POSTGRES_EPOCH_JDATE, generate_unaccent_rules::str, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Datum date_larger | ( | PG_FUNCTION_ARGS | ) |
Datum date_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 402 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Referenced by gbt_datele().
Datum date_le_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 801 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_le_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 885 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum date_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 393 of file date.c.
References PG_GETARG_DATEADT, and PG_RETURN_BOOL.
Referenced by gbt_datelt().
Datum date_lt_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 783 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_lt_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 867 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum date_mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 492 of file date.c.
References DATE_NOT_FINITE, ereport, errcode(), errmsg(), ERROR, PG_GETARG_DATEADT, and PG_RETURN_INT32.
Referenced by date_dist(), gbt_date_penalty(), and gdb_date_dist().
Datum date_mi_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1270 of file date.c.
References date2timestamp(), DirectFunctionCall2, PG_GETARG_DATEADT, PG_GETARG_INTERVAL_P, PointerGetDatum, timestamp_mi_interval(), and TimestampGetDatum.
Datum date_mii | ( | PG_FUNCTION_ARGS | ) |
Definition at line 533 of file date.c.
References DATE_NOT_FINITE, days, ereport, errcode(), errmsg(), ERROR, IS_VALID_DATE, PG_GETARG_DATEADT, PG_GETARG_INT32, and PG_RETURN_DATEADT.
Datum date_ne | ( | PG_FUNCTION_ARGS | ) |
Datum date_ne_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 774 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum date_ne_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 858 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum date_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 176 of file date.c.
References buf, DATE_NOT_FINITE, DateStyle, EncodeDateOnly(), EncodeSpecialDate(), j2date(), MAXDATELEN, PG_GETARG_DATEADT, PG_RETURN_CSTRING, POSTGRES_EPOCH_JDATE, pstrdup(), tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Datum date_pl_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1250 of file date.c.
References date2timestamp(), DirectFunctionCall2, PG_GETARG_DATEADT, PG_GETARG_INTERVAL_P, PointerGetDatum, timestamp_pl_interval(), and TimestampGetDatum.
Datum date_pli | ( | PG_FUNCTION_ARGS | ) |
Definition at line 509 of file date.c.
References DATE_NOT_FINITE, days, ereport, errcode(), errmsg(), ERROR, IS_VALID_DATE, PG_GETARG_DATEADT, PG_GETARG_INT32, and PG_RETURN_DATEADT.
Referenced by daterange_canonical().
Datum date_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 201 of file date.c.
References buf, DATE_NOT_FINITE, ereport, errcode(), errmsg(), ERROR, IS_VALID_DATE, PG_GETARG_POINTER, PG_RETURN_DATEADT, and pq_getmsgint().
Datum date_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 223 of file date.c.
References buf, PG_GETARG_DATEADT, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint32().
Datum date_smaller | ( | PG_FUNCTION_ARGS | ) |
Datum date_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 455 of file date.c.
References SortSupportData::comparator, date_fastcmp(), PG_GETARG_POINTER, and PG_RETURN_VOID.
Datum date_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1287 of file date.c.
References date2timestamp(), PG_GETARG_DATEADT, and PG_RETURN_TIMESTAMP.
Datum date_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1331 of file date.c.
References date2timestamptz(), PG_GETARG_DATEADT, and PG_RETURN_TIMESTAMP.
Datum datetime_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1967 of file date.c.
References date2timestamp(), ereport, errcode(), errmsg(), ERROR, IS_VALID_TIMESTAMP, PG_GETARG_DATEADT, PG_GETARG_TIMEADT, PG_RETURN_TIMESTAMP, and TIMESTAMP_NOT_FINITE.
Datum datetimetz_timestamptz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2861 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, ereport, errcode(), errmsg(), ERROR, IS_VALID_TIMESTAMP, PG_GETARG_DATEADT, PG_GETARG_TIMETZADT_P, PG_RETURN_TIMESTAMP, POSTGRES_EPOCH_JDATE, TimeTzADT::time, TIMESTAMP_END_JULIAN, TIMESTAMP_NOBEGIN, TIMESTAMP_NOEND, USECS_PER_DAY, USECS_PER_SEC, and TimeTzADT::zone.
void EncodeSpecialDate | ( | DateADT | dt, |
char * | str | ||
) |
Definition at line 286 of file date.c.
References DATE_IS_NOBEGIN, DATE_IS_NOEND, EARLY, elog, ERROR, and LATE.
Referenced by date_out(), and JsonEncodeDateTime().
Datum extract_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1071 of file date.c.
References CStringGetDatum, date2isoweek(), date2isoyear(), date2j(), DATE_IS_NOBEGIN, DATE_NOT_FINITE, DatumGetNumeric, DecodeSpecial(), DecodeUnits(), DirectFunctionCall3, downcase_truncate_identifier(), DTK_CENTURY, DTK_DAY, DTK_DECADE, DTK_DOW, DTK_DOY, DTK_EPOCH, DTK_ISODOW, DTK_ISOYEAR, DTK_JULIAN, DTK_MILLENNIUM, DTK_MONTH, DTK_QUARTER, DTK_WEEK, DTK_YEAR, ereport, errcode(), errmsg(), ERROR, Int32GetDatum, int64_to_numeric(), InvalidOid, j2date(), j2day(), numeric_in(), ObjectIdGetDatum, PG_GETARG_DATEADT, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_NUMERIC, POSTGRES_EPOCH_JDATE, RESERV, SECS_PER_DAY, generate_unaccent_rules::type, UNITS, UNIX_EPOCH_JDATE, UNKNOWN_FIELD, val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum extract_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2242 of file date.c.
References time_part_common().
Datum extract_timetz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3025 of file date.c.
References timetz_part_common().
bool float_time_overflows | ( | int | hour, |
int | min, | ||
double | sec | ||
) |
Definition at line 1450 of file date.c.
References HOURS_PER_DAY, MINS_PER_HOUR, SECS_PER_MINUTE, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by make_time(), and make_timestamp_internal().
DateADT GetSQLCurrentDate | ( | void | ) |
Definition at line 301 of file date.c.
References date2j(), GetCurrentDateTime(), POSTGRES_EPOCH_JDATE, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Referenced by ExecEvalSQLValueFunction().
Definition at line 334 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), palloc(), TimeTzADT::time, tm, and tm2timetz().
Referenced by ExecEvalSQLValueFunction().
Definition at line 354 of file date.c.
References AdjustTimeForTypmod(), GetCurrentTimeUsec(), tm, and tm2time().
Referenced by ExecEvalSQLValueFunction().
Datum in_range_date_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1044 of file date.c.
References BoolGetDatum, date2timestamp(), DirectFunctionCall5, in_range_timestamp_interval(), IntervalPGetDatum, PG_GETARG_BOOL, PG_GETARG_DATEADT, PG_GETARG_INTERVAL_P, TimestampGetDatum, and val.
Datum in_range_time_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2093 of file date.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_BOOL, PG_GETARG_INTERVAL_P, PG_GETARG_TIMEADT, PG_RETURN_BOOL, Interval::time, and val.
Datum in_range_timetz_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2627 of file date.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_BOOL, PG_GETARG_INTERVAL_P, PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, TimeTzADT::time, Interval::time, timetz_cmp_internal(), val, and TimeTzADT::zone.
Datum interval_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2013 of file date.c.
References days, PG_GETARG_INTERVAL_P, PG_RETURN_TIMEADT, Interval::time, and USECS_PER_DAY.
Datum make_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 237 of file date.c.
References date2j(), DTK_DATE_M, ereport, errcode(), errmsg(), ERROR, IS_VALID_DATE, IS_VALID_JULIAN, PG_GETARG_INT32, PG_RETURN_DATEADT, POSTGRES_EPOCH_JDATE, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, and ValidateDate().
Datum make_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1578 of file date.c.
References ereport, errcode(), errmsg(), ERROR, float_time_overflows(), MINS_PER_HOUR, PG_GETARG_FLOAT8, PG_GETARG_INT32, PG_RETURN_TIMEADT, SECS_PER_MINUTE, pg_tm::tm_hour, pg_tm::tm_min, and USECS_PER_SEC.
Datum overlaps_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1784 of file date.c.
References PG_ARGISNULL, PG_GETARG_DATUM, PG_RETURN_BOOL, PG_RETURN_NULL, TIMEADT_GT, and TIMEADT_LT.
Datum overlaps_timetz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2670 of file date.c.
References PG_ARGISNULL, PG_GETARG_DATUM, PG_RETURN_BOOL, PG_RETURN_NULL, TIMETZ_GT, and TIMETZ_LT.
Definition at line 1489 of file date.c.
References pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.
Referenced by JsonEncodeDateTime(), time_out(), time_part_common(), and time_timetz().
Datum time_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1735 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_INT32.
Referenced by compareDatetime(), gbt_timekey_cmp(), and leftmostvalue_time().
Datum time_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1681 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_BOOL.
Referenced by gbt_timeeq().
Datum time_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1726 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_BOOL.
Referenced by gbt_timege().
Datum time_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1717 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_BOOL.
Referenced by gbt_timegt().
Datum time_hash | ( | PG_FUNCTION_ARGS | ) |
Datum time_hash_extended | ( | PG_FUNCTION_ARGS | ) |
Datum time_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1378 of file date.c.
References AdjustTimeForTypmod(), DateTimeParseError(), DecodeTimeOnly(), MAXDATEFIELDS, MAXDATELEN, ParseDateTime(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_TIMEADT, generate_unaccent_rules::str, tm, and tm2time().
Datum time_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1990 of file date.c.
References Interval::day, Interval::month, palloc(), PG_GETARG_TIMEADT, PG_RETURN_INTERVAL_P, and Interval::time.
Datum time_larger | ( | PG_FUNCTION_ARGS | ) |
Datum time_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1708 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_BOOL.
Referenced by gbt_timele().
Datum time_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1699 of file date.c.
References PG_GETARG_TIMEADT, and PG_RETURN_BOOL.
Referenced by gbt_timelt().
Datum time_mi_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2075 of file date.c.
References PG_GETARG_INTERVAL_P, PG_GETARG_TIMEADT, PG_RETURN_TIMEADT, Interval::time, and USECS_PER_DAY.
Datum time_mi_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2038 of file date.c.
References Interval::day, Interval::month, palloc(), PG_GETARG_TIMEADT, PG_RETURN_INTERVAL_P, and Interval::time.
Referenced by gbt_time_dist(), gbt_time_penalty(), and time_dist().
Datum time_ne | ( | PG_FUNCTION_ARGS | ) |
Datum time_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1502 of file date.c.
References buf, DateStyle, EncodeTimeOnly(), MAXDATELEN, PG_GETARG_TIMEADT, PG_RETURN_CSTRING, pstrdup(), time2tm(), and tm.
Definition at line 1426 of file date.c.
References HOURS_PER_DAY, MINS_PER_HOUR, SECS_PER_MINUTE, USECS_PER_DAY, and USECS_PER_SEC.
Referenced by DecodeDateTime(), and DecodeTimeOnly().
Datum time_part | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2236 of file date.c.
References time_part_common().
|
static |
Definition at line 2133 of file date.c.
References DecodeSpecial(), DecodeUnits(), downcase_truncate_identifier(), DTK_CENTURY, DTK_DAY, DTK_DECADE, DTK_EPOCH, DTK_HOUR, DTK_ISOYEAR, DTK_MICROSEC, DTK_MILLENNIUM, DTK_MILLISEC, DTK_MINUTE, DTK_MONTH, DTK_QUARTER, DTK_SECOND, DTK_TZ, DTK_TZ_HOUR, DTK_TZ_MINUTE, DTK_YEAR, ereport, errcode(), errmsg(), ERROR, int64_div_fast_to_numeric(), int64_to_numeric(), PG_GETARG_TEXT_PP, PG_GETARG_TIMEADT, PG_RETURN_FLOAT8, PG_RETURN_NUMERIC, RESERV, time2tm(), tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, generate_unaccent_rules::type, UNITS, UNKNOWN_FIELD, val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by extract_time(), and time_part().
Datum time_pl_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2057 of file date.c.
References PG_GETARG_INTERVAL_P, PG_GETARG_TIMEADT, PG_RETURN_TIMEADT, Interval::time, and USECS_PER_DAY.
Datum time_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1522 of file date.c.
References AdjustTimeForTypmod(), buf, ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_TIMEADT, pq_getmsgint64(), and USECS_PER_DAY.
Datum time_scale | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1626 of file date.c.
References AdjustTimeForTypmod(), PG_GETARG_INT32, PG_GETARG_TIMEADT, and PG_RETURN_TIMEADT.
Datum time_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1548 of file date.c.
References buf, PG_GETARG_TIMEADT, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint64().
Datum time_smaller | ( | PG_FUNCTION_ARGS | ) |
Datum time_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1606 of file date.c.
References SupportRequestSimplify::fcall, IsA, MAX_TIME_PRECISION, PG_GETARG_POINTER, PG_RETURN_POINTER, and TemporalSimplify().
Datum time_timetz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2803 of file date.c.
References DetermineTimeZoneOffset(), GetCurrentDateTime(), palloc(), PG_GETARG_TIMEADT, PG_RETURN_TIMETZADT_P, session_timezone, TimeTzADT::time, time2tm(), tm, and TimeTzADT::zone.
Referenced by castTimeToTimeTz().
Datum timestamp_cmp_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 966 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_INT32.
Datum timestamp_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1301 of file date.c.
References date2j(), DATE_NOBEGIN, DATE_NOEND, ereport, errcode(), errmsg(), ERROR, PG_GETARG_TIMESTAMP, PG_RETURN_DATEADT, POSTGRES_EPOCH_JDATE, timestamp2tm(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Datum timestamp_eq_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 912 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_ge_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 957 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_gt_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 939 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_le_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 948 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_lt_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 930 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_ne_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 921 of file date.c.
References date_cmp_timestamp_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMP, and PG_RETURN_BOOL.
Datum timestamp_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1906 of file date.c.
References ereport, errcode(), errmsg(), ERROR, MINS_PER_HOUR, PG_GETARG_TIMESTAMP, PG_RETURN_NULL, PG_RETURN_TIMEADT, SECS_PER_MINUTE, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, and USECS_PER_SEC.
Datum timestamptz_cmp_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1029 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_INT32.
Datum timestamptz_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1346 of file date.c.
References date2j(), DATE_NOBEGIN, DATE_NOEND, ereport, errcode(), errmsg(), ERROR, PG_GETARG_TIMESTAMP, PG_RETURN_DATEADT, POSTGRES_EPOCH_JDATE, timestamp2tm(), TIMESTAMP_IS_NOBEGIN, TIMESTAMP_IS_NOEND, tm, pg_tm::tm_mday, pg_tm::tm_mon, and pg_tm::tm_year.
Datum timestamptz_eq_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 975 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_ge_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1020 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_gt_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1002 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_le_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1011 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_lt_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 993 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_ne_date | ( | PG_FUNCTION_ARGS | ) |
Definition at line 984 of file date.c.
References date_cmp_timestamptz_internal(), PG_GETARG_DATEADT, PG_GETARG_TIMESTAMPTZ, and PG_RETURN_BOOL.
Datum timestamptz_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1936 of file date.c.
References ereport, errcode(), errmsg(), ERROR, MINS_PER_HOUR, PG_GETARG_TIMESTAMP, PG_RETURN_NULL, PG_RETURN_TIMEADT, SECS_PER_MINUTE, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, and USECS_PER_SEC.
Datum timestamptz_timetz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2829 of file date.c.
References ereport, errcode(), errmsg(), ERROR, palloc(), PG_GETARG_TIMESTAMP, PG_RETURN_NULL, PG_RETURN_TIMETZADT_P, timestamp2tm(), TIMESTAMP_NOT_FINITE, tm, and tm2timetz().
Datum timetypmodin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1559 of file date.c.
References anytime_typmodin(), PG_GETARG_ARRAYTYPE_P, and PG_RETURN_INT32.
Datum timetypmodout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1567 of file date.c.
References anytime_typmodout(), PG_GETARG_INT32, and PG_RETURN_CSTRING.
Definition at line 2390 of file date.c.
References TimeTzADT::time, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, USECS_PER_HOUR, USECS_PER_MINUTE, USECS_PER_SEC, and TimeTzADT::zone.
Referenced by JsonEncodeDateTime(), timetz_out(), and timetz_part_common().
Datum timetz_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2511 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_INT32, and timetz_cmp_internal().
Referenced by compareDatetime(), and leftmostvalue_timetz().
Definition at line 2430 of file date.c.
References TimeTzADT::time, USECS_PER_SEC, and TimeTzADT::zone.
Referenced by in_range_timetz_interval(), timetz_cmp(), timetz_eq(), timetz_ge(), timetz_gt(), timetz_larger(), timetz_le(), timetz_lt(), timetz_ne(), and timetz_smaller().
Datum timetz_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2457 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2502 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2493 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_hash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2520 of file date.c.
References DatumGetUInt32, DirectFunctionCall1, hash_uint32(), hashint8(), Int64GetDatumFast, sort-test::key, PG_GETARG_TIMETZADT_P, PG_RETURN_UINT32, TimeTzADT::time, and TimeTzADT::zone.
Datum timetz_hash_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2536 of file date.c.
References DatumGetInt64, DatumGetUInt64, DirectFunctionCall2, hash_uint32_extended(), hashint8extended(), Int64GetDatumFast, sort-test::key, PG_GETARG_DATUM, PG_GETARG_TIMETZADT_P, PG_RETURN_UINT64, TimeTzADT::time, and TimeTzADT::zone.
Datum timetz_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2266 of file date.c.
References AdjustTimeForTypmod(), DateTimeParseError(), DecodeTimeOnly(), MAXDATEFIELDS, MAXDATELEN, palloc(), ParseDateTime(), PG_GETARG_CSTRING, PG_GETARG_INT32, PG_GETARG_OID, PG_RETURN_TIMETZADT_P, generate_unaccent_rules::str, TimeTzADT::time, tm, and tm2timetz().
Datum timetz_izone | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3117 of file date.c.
References DatumGetCString, Interval::day, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, interval_out(), Interval::month, palloc(), PG_GETARG_INTERVAL_P, PG_GETARG_TIMETZADT_P, PG_RETURN_TIMETZADT_P, PointerGetDatum, TimeTzADT::time, Interval::time, USECS_PER_DAY, USECS_PER_SEC, and TimeTzADT::zone.
Datum timetz_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2552 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_TIMETZADT_P, and timetz_cmp_internal().
Datum timetz_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2484 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2475 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_mi_interval | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2605 of file date.c.
References palloc(), PG_GETARG_INTERVAL_P, PG_GETARG_TIMETZADT_P, PG_RETURN_TIMETZADT_P, TimeTzADT::time, Interval::time, USECS_PER_DAY, and TimeTzADT::zone.
Datum timetz_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2466 of file date.c.
References PG_GETARG_TIMETZADT_P, PG_RETURN_BOOL, and timetz_cmp_internal().
Datum timetz_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2301 of file date.c.
References buf, DateStyle, EncodeTimeOnly(), MAXDATELEN, PG_GETARG_TIMETZADT_P, PG_RETURN_CSTRING, pstrdup(), timetz2tm(), and tm.
Datum timetz_part | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3019 of file date.c.
References timetz_part_common().
|
static |
Definition at line 2902 of file date.c.
References DecodeSpecial(), DecodeUnits(), downcase_truncate_identifier(), DTK_CENTURY, DTK_DAY, DTK_DECADE, DTK_EPOCH, DTK_HOUR, DTK_MICROSEC, DTK_MILLENNIUM, DTK_MILLISEC, DTK_MINUTE, DTK_MONTH, DTK_QUARTER, DTK_SECOND, DTK_TZ, DTK_TZ_HOUR, DTK_TZ_MINUTE, DTK_YEAR, ereport, errcode(), errmsg(), ERROR, int64_div_fast_to_numeric(), int64_to_numeric(), MINS_PER_HOUR, PG_GETARG_TEXT_PP, PG_GETARG_TIMETZADT_P, PG_RETURN_FLOAT8, PG_RETURN_NUMERIC, RESERV, SECS_PER_HOUR, SECS_PER_MINUTE, TimeTzADT::time, timetz2tm(), tm, pg_tm::tm_hour, pg_tm::tm_min, pg_tm::tm_sec, generate_unaccent_rules::type, UNITS, UNKNOWN_FIELD, val, VARDATA_ANY, VARSIZE_ANY_EXHDR, and TimeTzADT::zone.
Referenced by extract_timetz(), and timetz_part().