We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent4448917 commit327b257Copy full SHA for 327b257
contrib/btree_gin/btree_gin.c
@@ -394,10 +394,11 @@ static TypeInfo TypeInfo_varbit = {true, leftmostvalue_varbit, bitcmp};
394
GIN_SUPPORT(varbit)
395
396
/*
397
- * Numeric type hasn't applicable left-most value, so NULL
398
- * is used for that. NULL will never be an argument for a C-level
399
- * numeric function except gin_numeric_cmp and it will not be stored
400
- * 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
401
+ * functions. The same trick could be used for other pass-by-reference types.
402
*/
403
404
#defineNUMERIC_IS_LEFTMOST(x)((x) == NULL)