should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,71 @@
/*-------------------------------------------------------------------------
*
* datetime.h
* Definitions for date/time support code.
* The support code is shared with other date data types,
* including abstime, reltime, date, and time.
*
*
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development PGGroup
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/datetime.h
*
*-------------------------------------------------------------------------
*/
#pragma once
#include "nodes/nodes.hpp"
#include "utils/timestamp.hpp"
/*
* Field types for time decoding.
*
* Can't have more of these than there are bits in an unsigned int
* since these are turned into bit masks during parsing and decoding.
*
* Furthermore, the values for YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
* must be in the range 0..14 so that the associated bitmasks can fit
* into the left half of an INTERVAL's typmod value. Since those bits
* are stored in typmods, you can't change them without initdb!
*/
#define RESERV 0
#define MONTH 1
#define YEAR 2
#define DAY 3
#define JULIAN 4
#define TZ 5 /* fixed-offset timezone abbreviation */
#define DTZ 6 /* fixed-offset timezone abbrev, DST */
#define DYNTZ 7 /* dynamic timezone abbreviation */
#define IGNORE_DTF 8
#define AMPM 9
#define HOUR 10
#define MINUTE 11
#define SECOND 12
#define MILLISECOND 13
#define MICROSECOND 14
#define DOY 15
#define DOW 16
#define UNITS 17
#define ADBC 18
/* these are only for relative dates */
#define AGO 19
#define ABS_BEFORE 20
#define ABS_AFTER 21
/* generic fields to help with parsing */
#define ISODATE 22
#define ISOTIME 23
/* these are only for parsing intervals */
#define WEEK 24
#define DECADE 25
#define CENTURY 26
#define MILLENNIUM 27
/* hack for parsing two-word timezone specs "MET DST" etc */
#define DTZMOD 28 /* "DST" as a separate word */
#define QUARTER 29
/* reserved for unrecognized string values */
#define UNKNOWN_FIELD 31

View File

@@ -0,0 +1,26 @@
/*-------------------------------------------------------------------------
*
* timestamp.h
* Definitions for the SQL "timestamp" and "interval" types.
*
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development PGGroup
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/timestamp.h
*
*-------------------------------------------------------------------------
*/
#pragma once
#include "datatype/timestamp.hpp"
#include "fmgr.hpp"
#include "pgtime.hpp"
/* Macros to handle packing and unpacking the typmod field for intervals */
#define INTERVAL_FULL_RANGE (0x7FFF)
#define INTERVAL_RANGE_MASK (0x7FFF)
#define INTERVAL_FULL_PRECISION (0xFFFF)
#define INTERVAL_PRECISION_MASK (0xFFFF)
#define INTERVAL_TYPMOD(p,r) ((((r) & INTERVAL_RANGE_MASK) << 16) | ((p) & INTERVAL_PRECISION_MASK))
#define INTERVAL_PRECISION(t) ((t) & INTERVAL_PRECISION_MASK)
#define INTERVAL_RANGE(t) (((t) >> 16) & INTERVAL_RANGE_MASK)