summaryrefslogtreecommitdiff
path: root/contrib/btree_gin
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-01-09 15:24:22 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-01-09 15:25:17 -0500
commit327b25768217f5d4fd82770d0ab449814548f094 (patch)
tree6db4cd82153e05fd89c25c94c12df6c0ea7d03f4 /contrib/btree_gin
parent4448917d51d6f87655ce357cca009634b0a136e4 (diff)
downloadpostgresql-327b25768217f5d4fd82770d0ab449814548f094.tar.gz
Improve comment.
Diffstat (limited to 'contrib/btree_gin')
-rw-r--r--contrib/btree_gin/btree_gin.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c
index f8fae18eaf..486a662c78 100644
--- a/contrib/btree_gin/btree_gin.c
+++ b/contrib/btree_gin/btree_gin.c
@@ -394,10 +394,11 @@ static TypeInfo TypeInfo_varbit = {true, leftmostvalue_varbit, bitcmp};
GIN_SUPPORT(varbit)
/*
- * Numeric type hasn't applicable left-most value, so NULL
- * is used for that. NULL will never be an argument for a C-level
- * numeric function except gin_numeric_cmp and it will not be stored
- * somewhere and it could not be returned in any user SQL query.
+ * Numeric type hasn't a real left-most value, so we use PointerGetDatum(NULL)
+ * (*not* a SQL NULL) to represent that. We can get away with that because
+ * the value returned by our leftmostvalue function will never be stored in
+ * the index nor passed to anything except our compare and prefix-comparison
+ * functions. The same trick could be used for other pass-by-reference types.
*/
#define NUMERIC_IS_LEFTMOST(x) ((x) == NULL)