@@ -113,12 +113,12 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo)
113113 cmp ;
114114
115115 cmp = DatumGetInt32 (DirectFunctionCall2Coll (
116- data -> typecmp ,
117- PG_GET_COLLATION (),
118- (data -> strategy == BTLessStrategyNumber ||
119- data -> strategy == BTLessEqualStrategyNumber )
120- ? data -> datum : a ,
121- b ));
116+ data -> typecmp ,
117+ PG_GET_COLLATION (),
118+ (data -> strategy == BTLessStrategyNumber ||
119+ data -> strategy == BTLessEqualStrategyNumber )
120+ ? data -> datum : a ,
121+ b ));
122122
123123 switch (data -> strategy )
124124 {
@@ -186,14 +186,14 @@ Datum \
186186gin_extract_value_##type(PG_FUNCTION_ARGS) \
187187{ \
188188 return gin_btree_extract_value(fcinfo, is_varlena); \
189- } \
189+ } \
190190PG_FUNCTION_INFO_V1(gin_extract_query_##type); \
191191Datum \
192192gin_extract_query_##type(PG_FUNCTION_ARGS) \
193193{ \
194194 return gin_btree_extract_query(fcinfo, \
195195 is_varlena, leftmostvalue, typecmp); \
196- } \
196+ } \
197197PG_FUNCTION_INFO_V1(gin_compare_prefix_##type); \
198198Datum \
199199gin_compare_prefix_##type(PG_FUNCTION_ARGS) \
@@ -209,13 +209,15 @@ leftmostvalue_int2(void)
209209{
210210 return Int16GetDatum (SHRT_MIN );
211211}
212+
212213GIN_SUPPORT (int2 , false, leftmostvalue_int2 , btint2cmp )
213214
214215static Datum
215216leftmostvalue_int4 (void )
216217{
217218 return Int32GetDatum (INT_MIN );
218219}
220+
219221GIN_SUPPORT (int4 , false, leftmostvalue_int4 , btint4cmp )
220222
221223static Datum
@@ -226,20 +228,23 @@ leftmostvalue_int8(void)
226228 */
227229 return Int64GetDatum (SEQ_MINVALUE );
228230}
231+
229232GIN_SUPPORT (int8 , false, leftmostvalue_int8 , btint8cmp )
230233
231234static Datum
232235leftmostvalue_float4 (void )
233236{
234237 return Float4GetDatum (- get_float4_infinity ());
235238}
239+
236240GIN_SUPPORT (float4 , false, leftmostvalue_float4 , btfloat4cmp )
237241
238242static Datum
239243leftmostvalue_float8 (void )
240244{
241245 return Float8GetDatum (- get_float8_infinity ());
242246}
247+
243248GIN_SUPPORT (float8 , false, leftmostvalue_float8 , btfloat8cmp )
244249
245250static Datum
@@ -250,20 +255,23 @@ leftmostvalue_money(void)
250255 */
251256 return Int64GetDatum (SEQ_MINVALUE );
252257}
258+
253259GIN_SUPPORT (money , false, leftmostvalue_money , cash_cmp )
254260
255261static Datum
256262leftmostvalue_oid (void )
257263{
258264 return ObjectIdGetDatum (0 );
259265}
266+
260267GIN_SUPPORT (oid , false, leftmostvalue_oid , btoidcmp )
261268
262269static Datum
263270leftmostvalue_timestamp (void )
264271{
265272 return TimestampGetDatum (DT_NOBEGIN );
266273}
274+
267275GIN_SUPPORT (timestamp , false, leftmostvalue_timestamp , timestamp_cmp )
268276
269277GIN_SUPPORT (timestamptz , false, leftmostvalue_timestamp , timestamp_cmp )
@@ -273,6 +281,7 @@ leftmostvalue_time(void)
273281{
274282 return TimeADTGetDatum (0 );
275283}
284+
276285GIN_SUPPORT (time , false, leftmostvalue_time , time_cmp )
277286
278287static Datum
@@ -285,13 +294,15 @@ leftmostvalue_timetz(void)
285294
286295 return TimeTzADTPGetDatum (v );
287296}
297+
288298GIN_SUPPORT (timetz , false, leftmostvalue_timetz , timetz_cmp )
289299
290300static Datum
291301leftmostvalue_date (void )
292302{
293303 return DateADTGetDatum (DATEVAL_NOBEGIN );
294304}
305+
295306GIN_SUPPORT (date , false, leftmostvalue_date , date_cmp )
296307
297308static Datum
@@ -304,6 +315,7 @@ leftmostvalue_interval(void)
304315 v -> month = 0 ;
305316 return IntervalPGetDatum (v );
306317}
318+
307319GIN_SUPPORT (interval , false, leftmostvalue_interval , interval_cmp )
308320
309321static Datum
@@ -313,13 +325,15 @@ leftmostvalue_macaddr(void)
313325
314326 return MacaddrPGetDatum (v );
315327}
328+
316329GIN_SUPPORT (macaddr , false, leftmostvalue_macaddr , macaddr_cmp )
317330
318331static Datum
319332leftmostvalue_inet (void )
320333{
321334 return DirectFunctionCall1 (inet_in , CStringGetDatum ("0.0.0.0/0" ));
322335}
336+
323337GIN_SUPPORT (inet , true, leftmostvalue_inet , network_cmp )
324338
325339GIN_SUPPORT (cidr , true, leftmostvalue_inet , network_cmp )
@@ -329,13 +343,15 @@ leftmostvalue_text(void)
329343{
330344 return PointerGetDatum (cstring_to_text_with_len ("" , 0 ));
331345}
346+
332347GIN_SUPPORT (text , true, leftmostvalue_text , bttextcmp )
333348
334349static Datum
335350leftmostvalue_char (void )
336351{
337352 return CharGetDatum (SCHAR_MIN );
338353}
354+
339355GIN_SUPPORT (char , false, leftmostvalue_char , btcharcmp )
340356
341357GIN_SUPPORT (bytea , true, leftmostvalue_text , byteacmp )
@@ -348,6 +364,7 @@ leftmostvalue_bit(void)
348364 ObjectIdGetDatum (0 ),
349365 Int32GetDatum (-1 ));
350366}
367+
351368GIN_SUPPORT (bit , true, leftmostvalue_bit , bitcmp )
352369
353370static Datum
@@ -358,6 +375,7 @@ leftmostvalue_varbit(void)
358375 ObjectIdGetDatum (0 ),
359376 Int32GetDatum (-1 ));
360377}
378+
361379GIN_SUPPORT (varbit , true, leftmostvalue_varbit , bitcmp )
362380
363381/*
@@ -402,4 +420,5 @@ leftmostvalue_numeric(void)
402420{
403421 return PointerGetDatum (NULL );
404422}
423+
405424GIN_SUPPORT (numeric , true, leftmostvalue_numeric , gin_numeric_cmp )
0 commit comments