]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Refactor the way code is shared between some range type functions.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 18 Jul 2012 19:34:06 +0000 (22:34 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 18 Jul 2012 20:15:08 +0000 (23:15 +0300)
commit79c49131fa59069c70bda107c082199e9f8bd880
treea5eebc468dc3dc2d54a777e2f98af2d5bcad1909
parent1e9326d6a3efcb5648a85c1653cc263bc787efa0
Refactor the way code is shared between some range type functions.

Functions like range_eq, range_before etc. are exposed at the SQL-level, but
they're also used internally by the GiST consistent support function. The
code sharing was done by a hack, TrickFunctionCall2, which relied on the
knowledge that all the functions used fn_extra the same way. This commit
splits the functions into internal versions that take a TypeCacheEntry as
argument, and thin wrappers to expose the functions at the SQL-level. The
internal versions can then be called directly and in a less hacky way from
the GiST consistent function.

This is just cosmetic, but backpatch to 9.2 anyway, to avoid having a
different version of this code in the 9.2 branch. That would make
backpatching fixes in this area more difficult.

Alexander Korotkov
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/rangetypes_gist.c
src/include/utils/rangetypes.h