PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/hashfn.h"
#include "lib/hyperloglog.h"
#include "libpq/pqformat.h"
#include "port/pg_bswap.h"
#include "utils/fmgrprotos.h"
#include "utils/guc.h"
#include "utils/sortsupport.h"
#include "utils/timestamp.h"
#include "utils/uuid.h"
Go to the source code of this file.
Data Structures | |
struct | uuid_sortsupport_state |
Macros | |
#define | UUIDV1_EPOCH_JDATE 2299161 /* == date2j(1582,10,15) */ |
Functions | |
static void | string_to_uuid (const char *source, pg_uuid_t *uuid, Node *escontext) |
static int | uuid_internal_cmp (const pg_uuid_t *arg1, const pg_uuid_t *arg2) |
static int | uuid_fast_cmp (Datum x, Datum y, SortSupport ssup) |
static bool | uuid_abbrev_abort (int memtupcount, SortSupport ssup) |
static Datum | uuid_abbrev_convert (Datum original, SortSupport ssup) |
Datum | uuid_in (PG_FUNCTION_ARGS) |
Datum | uuid_out (PG_FUNCTION_ARGS) |
Datum | uuid_recv (PG_FUNCTION_ARGS) |
Datum | uuid_send (PG_FUNCTION_ARGS) |
Datum | uuid_lt (PG_FUNCTION_ARGS) |
Datum | uuid_le (PG_FUNCTION_ARGS) |
Datum | uuid_eq (PG_FUNCTION_ARGS) |
Datum | uuid_ge (PG_FUNCTION_ARGS) |
Datum | uuid_gt (PG_FUNCTION_ARGS) |
Datum | uuid_ne (PG_FUNCTION_ARGS) |
Datum | uuid_cmp (PG_FUNCTION_ARGS) |
Datum | uuid_sortsupport (PG_FUNCTION_ARGS) |
Datum | uuid_hash (PG_FUNCTION_ARGS) |
Datum | uuid_hash_extended (PG_FUNCTION_ARGS) |
Datum | gen_random_uuid (PG_FUNCTION_ARGS) |
Datum | uuid_extract_timestamp (PG_FUNCTION_ARGS) |
Datum | uuid_extract_version (PG_FUNCTION_ARGS) |
#define UUIDV1_EPOCH_JDATE 2299161 /* == date2j(1582,10,15) */ |
Datum gen_random_uuid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 405 of file uuid.c.
References pg_uuid_t::data, ereport, errcode(), errmsg(), ERROR, palloc(), PG_RETURN_UUID_P, pg_strong_random(), and UUID_LEN.
Referenced by pg_random_uuid().
Definition at line 95 of file uuid.c.
References pg_uuid_t::data, ereturn, errcode(), errmsg(), i, source, syntax_error(), and UUID_LEN.
Referenced by uuid_in().
|
static |
Definition at line 292 of file uuid.c.
References uuid_sortsupport_state::abbr_card, elog, estimateHyperLogLog(), uuid_sortsupport_state::estimating, uuid_sortsupport_state::input_count, INT64_FORMAT, LOG, SortSupportData::ssup_extra, and trace_sort.
Referenced by uuid_sortsupport().
|
static |
Definition at line 352 of file uuid.c.
References uuid_sortsupport_state::abbr_card, addHyperLogLog(), pg_uuid_t::data, DatumGetUInt32(), DatumGetUUIDP(), uuid_sortsupport_state::estimating, hash_uint32(), uuid_sortsupport_state::input_count, res, and SortSupportData::ssup_extra.
Referenced by uuid_sortsupport().
Datum uuid_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 229 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_INT32, and uuid_internal_cmp().
Datum uuid_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 192 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Datum uuid_extract_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 432 of file uuid.c.
References pg_uuid_t::data, PG_GETARG_UUID_P, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, POSTGRES_EPOCH_JDATE, SECS_PER_DAY, USECS_PER_SEC, and UUIDV1_EPOCH_JDATE.
Datum uuid_extract_version | ( | PG_FUNCTION_ARGS | ) |
Definition at line 473 of file uuid.c.
References pg_uuid_t::data, PG_GETARG_UUID_P, PG_RETURN_NULL, and PG_RETURN_UINT16.
|
static |
Definition at line 277 of file uuid.c.
References DatumGetUUIDP(), uuid_internal_cmp(), x, and y.
Referenced by uuid_sortsupport().
Datum uuid_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 201 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Datum uuid_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 210 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Datum uuid_hash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 389 of file uuid.c.
References hash_any(), sort-test::key, PG_GETARG_UUID_P, and UUID_LEN.
Datum uuid_hash_extended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 397 of file uuid.c.
References hash_any_extended(), sort-test::key, PG_GETARG_INT64, PG_GETARG_UUID_P, and UUID_LEN.
Datum uuid_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 42 of file uuid.c.
References palloc(), PG_GETARG_CSTRING, PG_RETURN_UUID_P, and string_to_uuid().
Referenced by uuid_generate_internal().
Definition at line 168 of file uuid.c.
References pg_uuid_t::data, and UUID_LEN.
Referenced by uuid_cmp(), uuid_eq(), uuid_fast_cmp(), uuid_ge(), uuid_gt(), uuid_le(), uuid_lt(), and uuid_ne().
Datum uuid_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 183 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Referenced by brin_minmax_multi_distance_uuid().
Datum uuid_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 174 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Datum uuid_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 219 of file uuid.c.
References PG_GETARG_UUID_P, PG_RETURN_BOOL, and uuid_internal_cmp().
Datum uuid_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 53 of file uuid.c.
References buf, pg_uuid_t::data, i, palloc(), PG_GETARG_UUID_P, PG_RETURN_CSTRING, and UUID_LEN.
Datum uuid_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 145 of file uuid.c.
References pg_uuid_t::data, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, pq_getmsgbytes(), and UUID_LEN.
Datum uuid_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 156 of file uuid.c.
References pg_uuid_t::data, PG_GETARG_UUID_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendbytes(), and UUID_LEN.
Datum uuid_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 241 of file uuid.c.
References uuid_sortsupport_state::abbr_card, SortSupportData::abbrev_abort, SortSupportData::abbrev_converter, SortSupportData::abbrev_full_comparator, SortSupportData::abbreviate, SortSupportData::comparator, uuid_sortsupport_state::estimating, initHyperLogLog(), uuid_sortsupport_state::input_count, MemoryContextSwitchTo(), palloc(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, ssup_datum_unsigned_cmp(), SortSupportData::ssup_extra, uuid_abbrev_abort(), uuid_abbrev_convert(), and uuid_fast_cmp().