diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-09-07 04:37:13 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-09-07 04:37:13 +0000 |
commit | c40ed5131948495a30caac2efff7927b673cd2d0 (patch) | |
tree | 4ee7a43fa571f53a370e60d0be421f4c6927c97f /src/backend/utils/adt/cash.c | |
parent | 432ca9116bc51f6cfe6e88be33dbe6cb078cda9d (diff) |
Update this branch to match CVS head, includes WIN32 improvements.
Diffstat (limited to 'src/backend/utils/adt/cash.c')
-rw-r--r-- | src/backend/utils/adt/cash.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index e33aad28d64..b6b4b6aa1be 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -9,7 +9,7 @@ * workings can be found in the book "Software Solutions in C" by * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.59 2003/07/27 04:53:03 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.59.2.1 2003/09/07 04:36:54 momjian Exp $ */ #include "postgres.h" @@ -342,6 +342,9 @@ cash_send(PG_FUNCTION_ARGS) PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); } +/* + * Comparison functions + */ Datum cash_eq(PG_FUNCTION_ARGS) @@ -397,6 +400,20 @@ cash_ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(c1 >= c2); } +Datum +cash_cmp(PG_FUNCTION_ARGS) +{ + Cash c1 = PG_GETARG_CASH(0); + Cash c2 = PG_GETARG_CASH(1); + + if (c1 > c2) + PG_RETURN_INT32(1); + else if (c1 == c2) + PG_RETURN_INT32(0); + else + PG_RETURN_INT32(-1); +} + /* cash_pl() * Add two cash values. |