summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2001-09-06 03:22:42 +0000
committerBruce Momjian2001-09-06 03:22:42 +0000
commit2a34134b6c5a46d8f905a82af51c55a7ec91ecac (patch)
treea791f893a03000fb533ea1efecd313c7478de2c1 /src/include
parent74dde13e2c5bab897ec2cd0b50e92cfae83f8109 (diff)
- new to_char(interval, text)
- new millisecond (ms) and microsecond (us) support - more robus parsing from string - used is separator checking for non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD') - SGML docs are included Karel Zak
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/pg_proc.h6
-rw-r--r--src/include/utils/formatting.h5
-rw-r--r--src/include/utils/timestamp.h5
3 files changed, 11 insertions, 5 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index c8919ff6833..fbea1d09a5c 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.207 2001/08/26 16:56:02 tgl Exp $
+ * $Id: pg_proc.h,v 1.208 2001/09/06 03:22:42 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2476,10 +2476,12 @@ DATA(insert OID = 1776 ( to_char PGUID 12 f t f t 2 f 25 "701 25" 100 0 0 100
DESCR("format float8 to text");
DATA(insert OID = 1777 ( to_number PGUID 12 f t f t 2 f 1700 "25 25" 100 0 0 100 numeric_to_number - ));
DESCR("convert text to numeric");
-DATA(insert OID = 1778 ( to_timestamp PGUID 12 f t f t 2 f 1184 "25 25" 100 0 0 100 to_timestamp - ));
+DATA(insert OID = 1778 ( to_timestamp PGUID 12 f t f t 2 f 1184 "25 25" 100 0 0 100 to_timestamp - ));
DESCR("convert text to timestamp");
DATA(insert OID = 1780 ( to_date PGUID 12 f t f t 2 f 1082 "25 25" 100 0 0 100 to_date - ));
DESCR("convert text to date");
+DATA(insert OID = 1768 ( to_char PGUID 12 f t f t 2 f 25 "1186 25" 100 0 0 100 interval_to_char - ));
+DESCR("format interval to text");
DATA(insert OID = 1282 ( quote_ident PGUID 12 f t t t 1 f 25 "25" 100 0 0 100 quote_ident - ));
DESCR("quote an identifier for usage in a querystring");
diff --git a/src/include/utils/formatting.h b/src/include/utils/formatting.h
index 4b713e59850..424bcf0fcba 100644
--- a/src/include/utils/formatting.h
+++ b/src/include/utils/formatting.h
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------
* formatting.h
*
- * $Id: formatting.h,v 1.7 2001/01/24 19:43:28 momjian Exp $
+ * $Id: formatting.h,v 1.8 2001/09/06 03:22:42 momjian Exp $
*
*
* Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group
@@ -10,7 +10,7 @@
* The PostgreSQL routines for a DateTime/int/float/numeric formatting,
* inspire with Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
*
- * Karel Zak - Zakkr
+ * Karel Zak
*
* -----------------------------------------------------------------------
*/
@@ -22,6 +22,7 @@
extern Datum timestamp_to_char(PG_FUNCTION_ARGS);
+extern Datum interval_to_char(PG_FUNCTION_ARGS);
extern Datum to_timestamp(PG_FUNCTION_ARGS);
extern Datum to_date(PG_FUNCTION_ARGS);
extern Datum numeric_to_number(PG_FUNCTION_ARGS);
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h
index 34af2ef85c3..11b650c88ac 100644
--- a/src/include/utils/timestamp.h
+++ b/src/include/utils/timestamp.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: timestamp.h,v 1.16 2001/03/22 04:01:14 momjian Exp $
+ * $Id: timestamp.h,v 1.17 2001/09/06 03:22:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -177,6 +177,9 @@ extern int tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *dt);
extern int timestamp2tm(Timestamp dt, int *tzp, struct tm * tm,
double *fsec, char **tzn);
+extern int interval2tm(Interval span, struct tm * tm, float8 *fsec);
+extern int tm2interval(struct tm * tm, double fsec, Interval *span);
+
extern Timestamp SetTimestamp(Timestamp timestamp);
extern void isoweek2date(int woy, int *year, int *mon, int *mday);