Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
74a40190
Commit
74a40190
authored
Jan 03, 2007
by
D'Arcy J.M. Cain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Widen the money type to 64 bits.
parent
d30d8f3a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
176 additions
and
111 deletions
+176
-111
src/backend/utils/adt/cash.c
src/backend/utils/adt/cash.c
+164
-102
src/include/catalog/pg_type.h
src/include/catalog/pg_type.h
+3
-3
src/include/utils/cash.h
src/include/utils/cash.h
+9
-6
No files found.
src/backend/utils/adt/cash.c
View file @
74a40190
This diff is collapsed.
Click to expand it.
src/include/catalog/pg_type.h
View file @
74a40190
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.17
6 2006/12/30 21:21:55 tgl
Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.17
7 2007/01/03 01:19:51 darcy
Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -388,10 +388,10 @@ DATA(insert OID = 718 ( circle PGNSP PGUID 24 f b t \054 0 0 circle_in circl
DESCR
(
"geometric circle '(center,radius)'"
);
#define CIRCLEOID 718
DATA
(
insert
OID
=
719
(
_circle
PGNSP
PGUID
-
1
f
b
t
\
054
0
718
array_in
array_out
array_recv
array_send
-
-
-
d
x
f
0
-
1
0
_null_
_null_
));
DATA
(
insert
OID
=
790
(
money
PGNSP
PGUID
4
f
b
t
\
054
0
0
cash_in
cash_out
cash_recv
cash_send
-
-
-
i
p
f
0
-
1
0
_null_
_null_
));
DATA
(
insert
OID
=
790
(
money
PGNSP
PGUID
8
f
b
t
\
054
0
0
cash_in
cash_out
cash_recv
cash_send
-
-
-
d
p
f
0
-
1
0
_null_
_null_
));
DESCR
(
"monetary amounts, $d,ddd.cc"
);
#define CASHOID 790
DATA
(
insert
OID
=
791
(
_money
PGNSP
PGUID
-
1
f
b
t
\
054
0
790
array_in
array_out
array_recv
array_send
-
-
-
i
x
f
0
-
1
0
_null_
_null_
));
DATA
(
insert
OID
=
791
(
_money
PGNSP
PGUID
-
1
f
b
t
\
054
0
790
array_in
array_out
array_recv
array_send
-
-
-
d
x
f
0
-
1
0
_null_
_null_
));
/* OIDS 800 - 899 */
DATA
(
insert
OID
=
829
(
macaddr
PGNSP
PGUID
6
f
b
t
\
054
0
0
macaddr_in
macaddr_out
macaddr_recv
macaddr_send
-
-
-
i
p
f
0
-
1
0
_null_
_null_
));
...
...
src/include/utils/cash.h
View file @
74a40190
...
...
@@ -3,7 +3,7 @@
* Written by D'Arcy J.M. Cain
*
* Functions to allow input and output of money normally but store
* and handle it as
int4
.
* and handle it as
64 bit integer
.
*/
#ifndef CASH_H
...
...
@@ -11,8 +11,7 @@
#include "fmgr.h"
/* if we store this as 4 bytes, we better make it int, not long, bjm */
typedef
int32
Cash
;
typedef
int64
Cash
;
extern
Datum
cash_in
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_out
(
PG_FUNCTION_ARGS
);
...
...
@@ -31,16 +30,20 @@ extern Datum cash_pl(PG_FUNCTION_ARGS);
extern
Datum
cash_mi
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_mul_flt8
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_flt8
(
PG_FUNCTION_ARGS
);
extern
Datum
flt8_mul_cash
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_flt8
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_mul_flt4
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_flt4
(
PG_FUNCTION_ARGS
);
extern
Datum
flt4_mul_cash
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_flt4
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_mul_int8
(
PG_FUNCTION_ARGS
);
extern
Datum
int8_mul_cash
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_int8
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_mul_int4
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_int4
(
PG_FUNCTION_ARGS
);
extern
Datum
int4_mul_cash
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_div_int4
(
PG_FUNCTION_ARGS
);
extern
Datum
cash_mul_int2
(
PG_FUNCTION_ARGS
);
extern
Datum
int2_mul_cash
(
PG_FUNCTION_ARGS
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment