MobilityDB 1.3
Loading...
Searching...
No Matches
formatting.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 * formatting.h
3 *
4 * src/include/utils/formatting.h
5 *
6 *
7 * Portions Copyright (c) 1999-2021, PostgreSQL Global Development Group
8 *
9 * The PostgreSQL routines for a DateTime/int/float/numeric formatting,
10 * inspired by the Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
11 *
12 * Karel Zak
13 *
14 * -----------------------------------------------------------------------
15 */
16
17#ifndef _FORMATTING_H_
18#define _FORMATTING_H_
19
20#include "utils/date.h"
21
22// extern char *str_tolower(const char *buff, size_t nbytes, Oid collid);
23// extern char *str_toupper(const char *buff, size_t nbytes, Oid collid);
24// extern char *str_initcap(const char *buff, size_t nbytes, Oid collid);
25
26extern char *asc_tolower(const char *buff, size_t nbytes);
27extern char *asc_toupper(const char *buff, size_t nbytes);
28extern char *asc_initcap(const char *buff, size_t nbytes);
29
30extern text *pg_timestamp_to_char(Timestamp dt, text *fmt);
32extern text *pg_interval_to_char(Interval *it, text *fmt);
33
34extern TimestampTz pg_to_timestamp(text *date_txt, text *fmt);
35extern DateADT pg_to_date(text *date_txt, text *fmt);
36
37// extern Datum parse_datetime(text *date_txt, text *fmt, Oid collid, bool strict,
38// Oid *typid, int32 *typmod, int *tz, bool *have_error);
39
40#endif
text * pg_timestamp_to_char(Timestamp dt, text *fmt)
Output a timestamp as text.
Definition: formatting.c:3186
text * pg_timestamptz_to_char(TimestampTz dt, text *fmt)
Output a timestamptz as text.
Definition: formatting.c:3219
char * asc_initcap(const char *buff, size_t nbytes)
Definition: formatting.c:1162
DateADT pg_to_date(text *date_txt, text *fmt)
Input a date from text.
Definition: formatting.c:3342
char * asc_toupper(const char *buff, size_t nbytes)
Definition: formatting.c:1139
char * asc_tolower(const char *buff, size_t nbytes)
Definition: formatting.c:1116
TimestampTz pg_to_timestamp(text *date_txt, text *fmt)
Input a timestamp from date text.
Definition: formatting.c:3294
text * pg_interval_to_char(Interval *it, text *fmt)
Output an interval as text.
Definition: formatting.c:3258
int64 Timestamp
Definition: postgres_ext_defs.in.h:21
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
int32 DateADT
Definition: postgres_ext_defs.in.h:19
Definition: postgres_ext_defs.in.h:27
Definition: postgres_ext_defs.in.h:34