@@ -113,12 +113,12 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo)
113
113
cmp ;
114
114
115
115
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 ));
122
122
123
123
switch (data -> strategy )
124
124
{
@@ -186,14 +186,14 @@ Datum \
186
186
gin_extract_value_##type(PG_FUNCTION_ARGS) \
187
187
{ \
188
188
return gin_btree_extract_value(fcinfo, is_varlena); \
189
- } \
189
+ } \
190
190
PG_FUNCTION_INFO_V1(gin_extract_query_##type); \
191
191
Datum \
192
192
gin_extract_query_##type(PG_FUNCTION_ARGS) \
193
193
{ \
194
194
return gin_btree_extract_query(fcinfo, \
195
195
is_varlena, leftmostvalue, typecmp); \
196
- } \
196
+ } \
197
197
PG_FUNCTION_INFO_V1(gin_compare_prefix_##type); \
198
198
Datum \
199
199
gin_compare_prefix_##type(PG_FUNCTION_ARGS) \
@@ -209,13 +209,15 @@ leftmostvalue_int2(void)
209
209
{
210
210
return Int16GetDatum (SHRT_MIN );
211
211
}
212
+
212
213
GIN_SUPPORT (int2 , false, leftmostvalue_int2 , btint2cmp )
213
214
214
215
static Datum
215
216
leftmostvalue_int4 (void )
216
217
{
217
218
return Int32GetDatum (INT_MIN );
218
219
}
220
+
219
221
GIN_SUPPORT (int4 , false, leftmostvalue_int4 , btint4cmp )
220
222
221
223
static Datum
@@ -226,20 +228,23 @@ leftmostvalue_int8(void)
226
228
*/
227
229
return Int64GetDatum (SEQ_MINVALUE );
228
230
}
231
+
229
232
GIN_SUPPORT (int8 , false, leftmostvalue_int8 , btint8cmp )
230
233
231
234
static Datum
232
235
leftmostvalue_float4 (void )
233
236
{
234
237
return Float4GetDatum (- get_float4_infinity ());
235
238
}
239
+
236
240
GIN_SUPPORT (float4 , false, leftmostvalue_float4 , btfloat4cmp )
237
241
238
242
static Datum
239
243
leftmostvalue_float8 (void )
240
244
{
241
245
return Float8GetDatum (- get_float8_infinity ());
242
246
}
247
+
243
248
GIN_SUPPORT (float8 , false, leftmostvalue_float8 , btfloat8cmp )
244
249
245
250
static Datum
@@ -250,20 +255,23 @@ leftmostvalue_money(void)
250
255
*/
251
256
return Int64GetDatum (SEQ_MINVALUE );
252
257
}
258
+
253
259
GIN_SUPPORT (money , false, leftmostvalue_money , cash_cmp )
254
260
255
261
static Datum
256
262
leftmostvalue_oid (void )
257
263
{
258
264
return ObjectIdGetDatum (0 );
259
265
}
266
+
260
267
GIN_SUPPORT (oid , false, leftmostvalue_oid , btoidcmp )
261
268
262
269
static Datum
263
270
leftmostvalue_timestamp (void )
264
271
{
265
272
return TimestampGetDatum (DT_NOBEGIN );
266
273
}
274
+
267
275
GIN_SUPPORT (timestamp , false, leftmostvalue_timestamp , timestamp_cmp )
268
276
269
277
GIN_SUPPORT (timestamptz , false, leftmostvalue_timestamp , timestamp_cmp )
@@ -273,6 +281,7 @@ leftmostvalue_time(void)
273
281
{
274
282
return TimeADTGetDatum (0 );
275
283
}
284
+
276
285
GIN_SUPPORT (time , false, leftmostvalue_time , time_cmp )
277
286
278
287
static Datum
@@ -285,13 +294,15 @@ leftmostvalue_timetz(void)
285
294
286
295
return TimeTzADTPGetDatum (v );
287
296
}
297
+
288
298
GIN_SUPPORT (timetz , false, leftmostvalue_timetz , timetz_cmp )
289
299
290
300
static Datum
291
301
leftmostvalue_date (void )
292
302
{
293
303
return DateADTGetDatum (DATEVAL_NOBEGIN );
294
304
}
305
+
295
306
GIN_SUPPORT (date , false, leftmostvalue_date , date_cmp )
296
307
297
308
static Datum
@@ -304,6 +315,7 @@ leftmostvalue_interval(void)
304
315
v -> month = 0 ;
305
316
return IntervalPGetDatum (v );
306
317
}
318
+
307
319
GIN_SUPPORT (interval , false, leftmostvalue_interval , interval_cmp )
308
320
309
321
static Datum
@@ -313,13 +325,15 @@ leftmostvalue_macaddr(void)
313
325
314
326
return MacaddrPGetDatum (v );
315
327
}
328
+
316
329
GIN_SUPPORT (macaddr , false, leftmostvalue_macaddr , macaddr_cmp )
317
330
318
331
static Datum
319
332
leftmostvalue_inet (void )
320
333
{
321
334
return DirectFunctionCall1 (inet_in , CStringGetDatum ("0.0.0.0/0" ));
322
335
}
336
+
323
337
GIN_SUPPORT (inet , true, leftmostvalue_inet , network_cmp )
324
338
325
339
GIN_SUPPORT (cidr , true, leftmostvalue_inet , network_cmp )
@@ -329,13 +343,15 @@ leftmostvalue_text(void)
329
343
{
330
344
return PointerGetDatum (cstring_to_text_with_len ("" , 0 ));
331
345
}
346
+
332
347
GIN_SUPPORT (text , true, leftmostvalue_text , bttextcmp )
333
348
334
349
static Datum
335
350
leftmostvalue_char (void )
336
351
{
337
352
return CharGetDatum (SCHAR_MIN );
338
353
}
354
+
339
355
GIN_SUPPORT (char , false, leftmostvalue_char , btcharcmp )
340
356
341
357
GIN_SUPPORT (bytea , true, leftmostvalue_text , byteacmp )
@@ -348,6 +364,7 @@ leftmostvalue_bit(void)
348
364
ObjectIdGetDatum (0 ),
349
365
Int32GetDatum (-1 ));
350
366
}
367
+
351
368
GIN_SUPPORT (bit , true, leftmostvalue_bit , bitcmp )
352
369
353
370
static Datum
@@ -358,6 +375,7 @@ leftmostvalue_varbit(void)
358
375
ObjectIdGetDatum (0 ),
359
376
Int32GetDatum (-1 ));
360
377
}
378
+
361
379
GIN_SUPPORT (varbit , true, leftmostvalue_varbit , bitcmp )
362
380
363
381
/*
@@ -402,4 +420,5 @@ leftmostvalue_numeric(void)
402
420
{
403
421
return PointerGetDatum (NULL );
404
422
}
423
+
405
424
GIN_SUPPORT (numeric , true, leftmostvalue_numeric , gin_numeric_cmp )
0 commit comments