]> granicus.if.org Git - postgresql/commit
Clean up some problems with redundant cross-type arithmetic operators. Add
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Jun 2008 19:10:56 +0000 (19:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Jun 2008 19:10:56 +0000 (19:10 +0000)
commitb163baa89ce0e4385497bc0f38deaf0078074d76
tree247ea4721f276d9c9cb608b1e3fd586aa861269c
parent4274726d4225158c69fef04aadc10e7e26f41971
Clean up some problems with redundant cross-type arithmetic operators.  Add
int2-and-int8 implementations of the basic arithmetic operators +, -, *, /.
This doesn't really add any new functionality, but it avoids "operator is not
unique" failures that formerly occurred in these cases because the parser
couldn't decide whether to promote the int2 to int4 or int8.  We could
alternatively have removed the existing cross-type operators, but
experimentation shows that the cost of an additional type coercion expression
node is noticeable compared to such cheap operators; so let's not give up any
performance here.  On the other hand, I removed the int2-and-int4 modulo (%)
operators since they didn't seem as important from a performance standpoint.
Per a complaint last January from ykhuang.
src/backend/utils/adt/int.c
src/backend/utils/adt/int8.c
src/include/catalog/catversion.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h
src/include/utils/int8.h