Skip site navigation (1) Skip section navigation (2)

pgsql: Refactor the way code is shared between some range typefunction

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Refactor the way code is shared between some range typefunction
Date: 2012-07-18 20:20:23
Message-ID: E1SrajP-0002Oh-RY@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
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

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/79c49131fa59069c70bda107c082199e9f8bd880

Modified Files
--------------
src/backend/utils/adt/rangetypes.c      |  219 ++++++++++++++++++++-----------
src/backend/utils/adt/rangetypes_gist.c |  168 ++++++++----------------
src/include/utils/rangetypes.h          |   24 ++++
3 files changed, 220 insertions(+), 191 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-07-19 17:07:56
Subject: pgsql: Send only one FORGET_RELATION_FSYNC request when dropping arela
Previous:From: Simon RiggsDate: 2012-07-18 20:18:33
Subject: Re: pgsql: Fix management of pendingOpsTable in auxiliary processes.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group