aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/formatting.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r--src/backend/utils/adt/formatting.c45
1 files changed, 5 insertions, 40 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 6f8734a947d..26f498b5df4 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1045,6 +1045,11 @@ typedef struct NUMProc
*L_currency_symbol;
} NUMProc;
+/* Return flags for DCH_from_char() */
+#define DCH_DATED 0x01
+#define DCH_TIMED 0x02
+#define DCH_ZONED 0x04
+
/* ----------
* Functions
* ----------
@@ -6707,43 +6712,3 @@ float8_to_char(PG_FUNCTION_ARGS)
NUM_TOCHAR_finish;
PG_RETURN_TEXT_P(result);
}
-
-int
-datetime_format_flags(const char *fmt_str, bool *have_error)
-{
- bool incache;
- int fmt_len = strlen(fmt_str);
- int result;
- FormatNode *format;
-
- if (fmt_len > DCH_CACHE_SIZE)
- {
- /*
- * Allocate new memory if format picture is bigger than static cache
- * and do not use cache (call parser always)
- */
- incache = false;
-
- format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode));
-
- parse_format(format, fmt_str, DCH_keywords,
- DCH_suff, DCH_index, DCH_FLAG, NULL);
- }
- else
- {
- /*
- * Use cache buffers
- */
- DCHCacheEntry *ent = DCH_cache_fetch(fmt_str, false);
-
- incache = true;
- format = ent->format;
- }
-
- result = DCH_datetime_type(format, have_error);
-
- if (!incache)
- pfree(format);
-
- return result;
-}