Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6691118

Browse files
committed
Add item:
> * Add NUMERIC division operator that doesn't round? > > Currently NUMERIC _rounds_ the result to the specified precision. > This means division can return a result that multiplied by the > divisor is greater than the dividend, e.g. this returns a value > 10: > > SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6; > > The positive modulus result returned by NUMERICs might be considered > inaccurate, in one sense. >
1 parent f3dbaca commit 6691118

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

doc/TODO

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PostgreSQL TODO List
33
====================
44
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
5-
Last updated: Fri Jun 24 17:28:23 EDT 2005
5+
Last updated: Fri Jun 24 21:32:02 EDT 2005
66

77
The most recent version of this document can be viewed at
88
http://www.postgresql.org/docs/faqs.TODO.html.
@@ -152,6 +152,17 @@ Data Types
152152

153153
* Remove Money type, add money formatting for decimal type
154154
* Change NUMERIC to enforce the maximum precision, and increase it
155+
* Add NUMERIC division operator that doesn't round?
156+
157+
Currently NUMERIC _rounds_ the result to the specified precision.
158+
This means division can return a result that multiplied by the
159+
divisor is greater than the dividend, e.g. this returns a value > 10:
160+
161+
SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
162+
163+
The positive modulus result returned by NUMERICs might be considered
164+
inaccurate, in one sense.
165+
155166
* Add function to return compressed length of TOAST data values
156167
* Allow INET subnet tests using non-constants to be indexed
157168
* Add transaction_timestamp(), statement_timestamp(), clock_timestamp()

doc/src/FAQ/TODO.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body bgcolor="#FFFFFF" text="#000000" link="#FF0000" vlink="#A00000" alink="#0000FF">
99
<h1><a name="section_1">PostgreSQL TODO List</a></h1>
1010
<p>Current maintainer: Bruce Momjian (<a href="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</a>)<br/>
11-
Last updated: Fri Jun 24 17:28:23 EDT 2005
11+
Last updated: Fri Jun 24 21:32:02 EDT 2005
1212
</p>
1313
<p>The most recent version of this document can be viewed at<br/>
1414
<a href="http://www.postgresql.org/docs/faqs.TODO.html">http://www.postgresql.org/docs/faqs.TODO.html</a>.
@@ -142,7 +142,19 @@ <h1><a name="section_3">Data Types</a></h1>
142142
<ul>
143143
<li>Remove Money type, add money formatting for decimal type
144144
</li><li>Change NUMERIC to enforce the maximum precision, and increase it
145-
</li><li>Add function to return compressed length of TOAST data values
145+
</li><li>Add NUMERIC division operator that doesn't round?
146+
<p> Currently NUMERIC _rounds_ the result to the specified precision.
147+
This means division can return a result that multiplied by the
148+
divisor is greater than the dividend, e.g. this returns a value &gt; 10:
149+
</p>
150+
</li></ul>
151+
<p> SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
152+
</p>
153+
<p> The positive modulus result returned by NUMERICs might be considered<br/>
154+
inaccurate, in one sense.
155+
</p>
156+
<ul>
157+
<li>Add function to return compressed length of TOAST data values
146158
</li><li>Allow INET subnet tests using non-constants to be indexed
147159
</li><li>Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
148160
functionality

0 commit comments

Comments
 (0)