On Thu, Dec 22, 2011 at 18:41, Robert Haas <[email protected]> wrote:
> On Mon, Dec 19, 2011 at 5:16 AM, Marti Raudsepp <[email protected]> wrote:
>> PS: It seems that the min/max optimization isn't documented in the
>> manual (apart from release notes), so I didn't include any doc changes
>> in this patch.
>
> I don't see a patch attached to this email, so either you forgot to
> attach it, or the list ate it somehow.
I forgot to attach it, sorry. Here it is.
Regards,
Marti
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 26966d2..29e262f 100644
--- a/src/include/catalog/pg_aggregate.h
+++ b/src/include/catalog/pg_aggregate.h
@@ -203,9 +203,9 @@ DATA(insert ( 2828 float8_regr_accum float8_covar_samp 0 1022 "{0,0,0,0,0,0}" )
DATA(insert ( 2829 float8_regr_accum float8_corr 0 1022 "{0,0,0,0,0,0}" ));
/* boolean-and and boolean-or */
-DATA(insert ( 2517 booland_statefunc - 0 16 _null_ ));
-DATA(insert ( 2518 boolor_statefunc - 0 16 _null_ ));
-DATA(insert ( 2519 booland_statefunc - 0 16 _null_ ));
+DATA(insert ( 2517 booland_statefunc - 58 16 _null_ ));
+DATA(insert ( 2518 boolor_statefunc - 59 16 _null_ ));
+DATA(insert ( 2519 booland_statefunc - 58 16 _null_ ));
/* bitwise integer */
DATA(insert ( 2236 int2and - 0 21 _null_ ));
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 51ab6e5..7d245d2 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -774,16 +774,19 @@ WHERE a.aggfnoid = p.oid AND
(0 rows)
-- Cross-check aggsortop (if present) against pg_operator.
--- We expect to find only "<" for "min" and ">" for "max".
+-- We expect to find "<" for min/bool_and/every and ">" for max/bool_or
SELECT DISTINCT proname, oprname
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p
WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid
ORDER BY 1;
- proname | oprname
----------+---------
- max | >
- min | <
-(2 rows)
+ proname | oprname
+----------+---------
+ bool_and | <
+ bool_or | >
+ every | <
+ max | >
+ min | <
+(5 rows)
-- Check datatypes match
SELECT a.aggfnoid::oid, o.oid
@@ -816,11 +819,14 @@ WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid AND
amopopr = o.oid AND
amopmethod = (SELECT oid FROM pg_am WHERE amname = 'btree')
ORDER BY 1, 2;
- proname | oprname | amopstrategy
----------+---------+--------------
- max | > | 5
- min | < | 1
-(2 rows)
+ proname | oprname | amopstrategy
+----------+---------+--------------
+ bool_and | < | 1
+ bool_or | > | 5
+ every | < | 1
+ max | > | 5
+ min | < | 1
+(5 rows)
-- Check that there are not aggregates with the same name and different
-- numbers of arguments. While not technically wrong, we have a project policy
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index e29148f..bcd8544 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -626,7 +626,7 @@ WHERE a.aggfnoid = p.oid AND
NOT binary_coercible(p.proargtypes[0], a.aggtranstype);
-- Cross-check aggsortop (if present) against pg_operator.
--- We expect to find only "<" for "min" and ">" for "max".
+-- We expect to find "<" for min/bool_and/every and ">" for max/bool_or
SELECT DISTINCT proname, oprname
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers