Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can
Tom Lane <tgl@sss.pgh.pa.us>
Add aggsortop column to pg_aggregate, so that MIN/MAX optimization can be supported for all datatypes. Add CREATE AGGREGATE and pg_dump support too. Add specialized min/max aggregates for bpchar, instead of depending on text's min/max, because otherwise the possible use of bpchar indexes cannot be recognized. initdb forced because of catalog changes.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +9 −3 |
| doc/src/sgml/ref/create_aggregate.sgml | modified | +38 −1 |
| src/backend/catalog/pg_aggregate.c | modified | +21 −2 |
| src/backend/commands/aggregatecmds.c | modified | +6 −2 |
| src/backend/optimizer/plan/planagg.c | modified | +1 −16 |
| src/backend/utils/adt/varchar.c | modified | +35 −1 |
| src/bin/pg_dump/pg_dump.c | modified | +30 −2 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_aggregate.h | modified | +86 −80 |
| src/include/catalog/pg_proc.h | modified | +7 −1 |
| src/include/utils/builtins.h | modified | +3 −1 |
| src/test/regress/expected/oidjoins.out | modified | +24 −8 |
| src/test/regress/expected/opr_sanity.out | modified | +47 −0 |
| src/test/regress/sql/oidjoins.sql | modified | +12 −4 |
| src/test/regress/sql/opr_sanity.sql | modified | +35 −0 |