File tree Expand file tree Collapse file tree 6 files changed +50
-6
lines changed Expand file tree Collapse file tree 6 files changed +50
-6
lines changed Original file line number Diff line number Diff line change 5
5
*
6
6
* 1998 Jan Wieck
7
7
*
8
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.19 1999/07/17 20:17:58 momjian Exp $
8
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.20 1999/09/29 21:13:25 wieck Exp $
9
9
*
10
10
* ----------
11
11
*/
@@ -690,6 +690,34 @@ numeric_floor(Numeric num)
690
690
*/
691
691
692
692
693
+ int32
694
+ numeric_cmp (Numeric num1 , Numeric num2 )
695
+ {
696
+ int result ;
697
+ NumericVar arg1 ;
698
+ NumericVar arg2 ;
699
+
700
+ if (num1 == NULL || num2 == NULL )
701
+ return (int32 )0 ;
702
+
703
+ if (NUMERIC_IS_NAN (num1 ) || NUMERIC_IS_NAN (num2 ))
704
+ return (int32 )0 ;
705
+
706
+ init_var (& arg1 );
707
+ init_var (& arg2 );
708
+
709
+ set_var_from_num (num1 , & arg1 );
710
+ set_var_from_num (num2 , & arg2 );
711
+
712
+ result = cmp_var (& arg1 , & arg2 );
713
+
714
+ free_var (& arg1 );
715
+ free_var (& arg2 );
716
+
717
+ return (int32 )((result == 0 ) ? 0 : ((result < 0 ) ? -1 : 1 ));
718
+ }
719
+
720
+
693
721
bool
694
722
numeric_eq (Numeric num1 , Numeric num2 )
695
723
{
Original file line number Diff line number Diff line change 7
7
*
8
8
* Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: pg_amop.h,v 1.23 1999/04/03 18:07:47 tgl Exp $
10
+ * $Id: pg_amop.h,v 1.24 1999/09/29 21:13:30 wieck Exp $
11
11
*
12
12
* NOTES
13
13
* the genbki.sh script reads this file and generates .bki
@@ -338,6 +338,16 @@ DATA(insert OID = 0 ( 403 652 820 3 btreesel btreenpage ));
338
338
DATA (insert OID = 0 ( 403 652 825 4 btreesel btreenpage ));
339
339
DATA (insert OID = 0 ( 403 652 824 5 btreesel btreenpage ));
340
340
341
+ /*
342
+ * nbtree numeric
343
+ */
344
+
345
+ DATA (insert OID = 0 ( 403 1768 1754 1 btreesel btreenpage ));
346
+ DATA (insert OID = 0 ( 403 1768 1755 2 btreesel btreenpage ));
347
+ DATA (insert OID = 0 ( 403 1768 1752 3 btreesel btreenpage ));
348
+ DATA (insert OID = 0 ( 403 1768 1757 4 btreesel btreenpage ));
349
+ DATA (insert OID = 0 ( 403 1768 1756 5 btreesel btreenpage ));
350
+
341
351
/*
342
352
* hash table _ops
343
353
*/
Original file line number Diff line number Diff line change 9
9
*
10
10
* Copyright (c) 1994, Regents of the University of California
11
11
*
12
- * $Id: pg_amproc.h,v 1.14 1999/03/26 07:32:41 tgl Exp $
12
+ * $Id: pg_amproc.h,v 1.15 1999/09/29 21:13:30 wieck Exp $
13
13
*
14
14
* NOTES
15
15
* the genbki.sh script reads this file and generates .bki
@@ -96,6 +96,7 @@ DATA(insert OID = 0 (403 1312 1314 1));
96
96
DATA (insert OID = 0 (403 1313 1315 1 ));
97
97
DATA (insert OID = 0 (403 810 836 1 ));
98
98
DATA (insert OID = 0 (403 935 926 1 ));
99
+ DATA (insert OID = 0 (403 1768 1769 1 ));
99
100
100
101
101
102
/* hash */
Original file line number Diff line number Diff line change 7
7
*
8
8
* Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: pg_opclass.h,v 1.19 1999/05/25 16 :13:45 momjian Exp $
10
+ * $Id: pg_opclass.h,v 1.20 1999/09/29 21 :13:30 wieck Exp $
11
11
*
12
12
* NOTES
13
13
* the genbki.sh script reads this file and generates .bki
@@ -115,5 +115,7 @@ DATA(insert OID = 935 ( network_ops 869 ));
115
115
DESCR ("" );
116
116
DATA (insert OID = 652 ( network_ops 650 ));
117
117
DESCR ("" );
118
+ DATA (insert OID = 1768 ( numeric_ops 1700 ));
119
+ DESCR ("" );
118
120
119
121
#endif /* PG_OPCLASS_H */
Original file line number Diff line number Diff line change 6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: pg_proc.h,v 1.102 1999/09/26 02:28:38 tgl Exp $
9
+ * $Id: pg_proc.h,v 1.103 1999/09/29 21:13:30 wieck Exp $
10
10
*
11
11
* NOTES
12
12
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2306,6 +2306,8 @@ DATA(insert OID = 1766 ( numeric_smaller PGUID 11 f t t 2 f 1700 "1700 1700" 10
2306
2306
DESCR ("smaller of two numbers" );
2307
2307
DATA (insert OID = 1767 ( numeric_larger PGUID 11 f t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_larger - ));
2308
2308
DESCR ("larger of two numbers" );
2309
+ DATA (insert OID = 1769 ( numeric_cmp PGUID 11 f t t 2 f 23 "1700 1700" 100 0 0 100 numeric_cmp - ));
2310
+ DESCR ("compare two numbers" );
2309
2311
2310
2312
2311
2313
/*
Original file line number Diff line number Diff line change 6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: builtins.h,v 1.85 1999/08/01 04:54:20 tgl Exp $
9
+ * $Id: builtins.h,v 1.86 1999/09/29 21:13:31 wieck Exp $
10
10
*
11
11
* NOTES
12
12
* This should normally only be included by fmgr.h.
@@ -572,6 +572,7 @@ Numeric numeric_round(Numeric num, int32 scale);
572
572
Numeric numeric_trunc (Numeric num , int32 scale );
573
573
Numeric numeric_ceil (Numeric num );
574
574
Numeric numeric_floor (Numeric num );
575
+ int32 numeric_cmp (Numeric num1 , Numeric num2 );
575
576
bool numeric_eq (Numeric num1 , Numeric num2 );
576
577
bool numeric_ne (Numeric num1 , Numeric num2 );
577
578
bool numeric_gt (Numeric num1 , Numeric num2 );
You can’t perform that action at this time.
0 commit comments