summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2002-10-19 02:08:19 +0000
committerBruce Momjian2002-10-19 02:08:19 +0000
commitbab3d29fbab48e803e9dec09733a388aa1bbba22 (patch)
tree2ddcdc3283080b626a1012e5edbfd1a895118fe3 /src/include
parent5c6a5fe18b2e8d1b4ec128c0441aca6d13d44121 (diff)
This patch adds some missing functions for float8 math operations,
specifically ceil(), floor(), and sign(). There may be other functions that need to be added, but this is a start. I've included some simple regression tests. Neil Conway
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_proc.h8
-rw-r--r--src/include/utils/builtins.h5
3 files changed, 13 insertions, 4 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 967cb794f7d..58df9af0abf 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.161 2002/10/14 22:14:35 tgl Exp $
+ * $Id: catversion.h,v 1.162 2002/10/19 02:08:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200210141
+#define CATALOG_VERSION_NO 200210181
#endif
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 369da463e8a..95197811ad8 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.273 2002/09/22 17:27:23 tgl Exp $
+ * $Id: pg_proc.h,v 1.274 2002/10/19 02:08:18 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -473,6 +473,12 @@ DATA(insert OID = 228 ( dround PGNSP PGUID 12 f f t f i 1 701 "701" droun
DESCR("round to nearest integer");
DATA(insert OID = 229 ( dtrunc PGNSP PGUID 12 f f t f i 1 701 "701" dtrunc - _null_ ));
DESCR("truncate to integer");
+DATA(insert OID = 2308 ( ceil PGNSP PGUID 12 f f t f i 1 701 "701" dceil - _null_ ));
+DESCR("smallest integer >= value");
+DATA(insert OID = 2309 ( floor PGNSP PGUID 12 f f t f i 1 701 "701" dfloor - _null_ ));
+DESCR("largest integer <= value");
+DATA(insert OID = 2310 ( sign PGNSP PGUID 12 f f t f i 1 701 "701" dsign - _null_ ));
+DESCR("sign of value");
DATA(insert OID = 230 ( dsqrt PGNSP PGUID 12 f f t f i 1 701 "701" dsqrt - _null_ ));
DESCR("square root");
DATA(insert OID = 231 ( dcbrt PGNSP PGUID 12 f f t f i 1 701 "701" dcbrt - _null_ ));
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index 9f1c9ba8dbf..990c9f36be8 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.202 2002/09/22 17:27:25 tgl Exp $
+ * $Id: builtins.h,v 1.203 2002/10/19 02:08:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -261,6 +261,9 @@ extern Datum text_float4(PG_FUNCTION_ARGS);
extern Datum float8_text(PG_FUNCTION_ARGS);
extern Datum float4_text(PG_FUNCTION_ARGS);
extern Datum dround(PG_FUNCTION_ARGS);
+extern Datum dceil(PG_FUNCTION_ARGS);
+extern Datum dfloor(PG_FUNCTION_ARGS);
+extern Datum dsign(PG_FUNCTION_ARGS);
extern Datum dtrunc(PG_FUNCTION_ARGS);
extern Datum dsqrt(PG_FUNCTION_ARGS);
extern Datum dcbrt(PG_FUNCTION_ARGS);