Skip to content

Commit 327b257

Browse files
committed
Improve comment.
1 parent 4448917 commit 327b257

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

contrib/btree_gin/btree_gin.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,11 @@ static TypeInfo TypeInfo_varbit = {true, leftmostvalue_varbit, bitcmp};
394394
GIN_SUPPORT(varbit)
395395

396396
/*
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.
397+
* Numeric type hasn't a real left-most value, so we use PointerGetDatum(NULL)
398+
* (*not* a SQL NULL) to represent that. We can get away with that because
399+
* the value returned by our leftmostvalue function will never be stored in
400+
* 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.
401402
*/
402403

403404
#define NUMERIC_IS_LEFTMOST(x) ((x) == NULL)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy