summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-08-14 22:21:59 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-08-14 22:21:59 +0000
commit5f7c2bdb537bd18fd7f1cc942950e7e64c6e0a92 (patch)
treedeb73ae98b59fb4315f82b781a7c22859cbccd00 /src/test
parent6f2943b52e9f4af3c4488c0373a3490e38c032a7 (diff)
downloadpostgresql-5f7c2bdb537bd18fd7f1cc942950e7e64c6e0a92.tar.gz
sum() on int2 and int4 columns now uses an int8, not numeric, accumulator
for speed reasons; its result type also changes to int8. avg() on these datatypes now accumulates the running sum in int8 for speed; but we still deliver the final result as numeric, so that fractional accuracy is preserved. count() now counts and returns in int8, not int4. I am a little nervous about this possibly breaking users' code, but there didn't seem to be a strong sentiment for avoiding the problem. If we get complaints during beta, we can change count back to int4 and add a "count8" aggregate. For that matter, users can do it for themselves with a simple CREATE AGGREGATE command; the int4inc function is still present, so no C hacking is needed. Also added max() and min() aggregates for OID that do proper unsigned comparison, instead of piggybacking on int4 aggregates. initdb forced.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/opr_sanity.out4
-rw-r--r--src/test/regress/expected/rules.out2
-rw-r--r--src/test/regress/sql/rules.sql2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 25f9439afc..164b07adc7 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -480,8 +480,8 @@ WHERE p1.aggtransfn = p2.oid AND
(p2.pronargs = 1 AND p1.aggbasetype = 0)));
oid | aggname | oid | proname
-------+---------+-----+-------------
- 10020 | max | 768 | int4larger
- 10034 | min | 769 | int4smaller
+ 10021 | max | 768 | int4larger
+ 10036 | min | 769 | int4smaller
(2 rows)
-- Cross-check finalfn (if present) against its entry in pg_proc.
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index a655f18809..2871fa68d7 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -753,7 +753,7 @@ create view rtest_vview4 as select X.a, X.b, count(Y.a) as refcount
where X.a = Y.a
group by X.a, X.b;
create function rtest_viewfunc1(int4) returns int4 as
- 'select count(*) from rtest_view2 where a = $1'
+ 'select count(*)::int4 from rtest_view2 where a = $1'
language 'sql';
create view rtest_vview5 as select a, b, rtest_viewfunc1(a) as refcount
from rtest_view1;
diff --git a/src/test/regress/sql/rules.sql b/src/test/regress/sql/rules.sql
index 5068face88..aa9fcbb728 100644
--- a/src/test/regress/sql/rules.sql
+++ b/src/test/regress/sql/rules.sql
@@ -422,7 +422,7 @@ create view rtest_vview4 as select X.a, X.b, count(Y.a) as refcount
where X.a = Y.a
group by X.a, X.b;
create function rtest_viewfunc1(int4) returns int4 as
- 'select count(*) from rtest_view2 where a = $1'
+ 'select count(*)::int4 from rtest_view2 where a = $1'
language 'sql';
create view rtest_vview5 as select a, b, rtest_viewfunc1(a) as refcount
from rtest_view1;