From c40ed5131948495a30caac2efff7927b673cd2d0 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 7 Sep 2003 04:37:13 +0000 Subject: Update this branch to match CVS head, includes WIN32 improvements. --- src/backend/utils/adt/cash.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/adt/cash.c') 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. -- cgit v1.2.3