PostgreSQL Source Code git master
oid8.c File Reference
#include "postgres.h"
#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
#include "utils/builtins.h"
Include dependency graph for oid8.c:

Go to the source code of this file.

Macros

#define MAXOID8LEN   20
 

Functions

Datum oid8in (PG_FUNCTION_ARGS)
 
Datum oid8out (PG_FUNCTION_ARGS)
 
Datum oid8recv (PG_FUNCTION_ARGS)
 
Datum oid8send (PG_FUNCTION_ARGS)
 
Datum oid8eq (PG_FUNCTION_ARGS)
 
Datum oid8ne (PG_FUNCTION_ARGS)
 
Datum oid8lt (PG_FUNCTION_ARGS)
 
Datum oid8le (PG_FUNCTION_ARGS)
 
Datum oid8ge (PG_FUNCTION_ARGS)
 
Datum oid8gt (PG_FUNCTION_ARGS)
 
Datum hashoid8 (PG_FUNCTION_ARGS)
 
Datum hashoid8extended (PG_FUNCTION_ARGS)
 
Datum oid8larger (PG_FUNCTION_ARGS)
 
Datum oid8smaller (PG_FUNCTION_ARGS)
 

Macro Definition Documentation

◆ MAXOID8LEN

#define MAXOID8LEN   20

Definition at line 21 of file oid8.c.

Function Documentation

◆ hashoid8()

Datum hashoid8 ( PG_FUNCTION_ARGS  )

Definition at line 141 of file oid8.c.

142{
143 return hashint8(fcinfo);
144}
Datum hashint8(PG_FUNCTION_ARGS)
Definition: hashfunc.c:83

References hashint8().

◆ hashoid8extended()

Datum hashoid8extended ( PG_FUNCTION_ARGS  )

Definition at line 147 of file oid8.c.

148{
149 return hashint8extended(fcinfo);
150}
Datum hashint8extended(PG_FUNCTION_ARGS)
Definition: hashfunc.c:103

References hashint8extended().

◆ oid8eq()

Datum oid8eq ( PG_FUNCTION_ARGS  )

Definition at line 87 of file oid8.c.

88{
89 Oid8 arg1 = PG_GETARG_OID8(0);
90 Oid8 arg2 = PG_GETARG_OID8(1);
91
92 PG_RETURN_BOOL(arg1 == arg2);
93}
uint64 Oid8
Definition: c.h:692
#define PG_GETARG_OID8(n)
Definition: fmgr.h:276
#define PG_RETURN_BOOL(x)
Definition: fmgr.h:360

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8ge()

Datum oid8ge ( PG_FUNCTION_ARGS  )

Definition at line 123 of file oid8.c.

124{
125 Oid8 arg1 = PG_GETARG_OID8(0);
126 Oid8 arg2 = PG_GETARG_OID8(1);
127
128 PG_RETURN_BOOL(arg1 >= arg2);
129}

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8gt()

Datum oid8gt ( PG_FUNCTION_ARGS  )

Definition at line 132 of file oid8.c.

133{
134 Oid8 arg1 = PG_GETARG_OID8(0);
135 Oid8 arg2 = PG_GETARG_OID8(1);
136
137 PG_RETURN_BOOL(arg1 > arg2);
138}

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8in()

Datum oid8in ( PG_FUNCTION_ARGS  )

Definition at line 28 of file oid8.c.

29{
30 char *s = PG_GETARG_CSTRING(0);
31 Oid8 result;
32
33 result = uint64in_subr(s, NULL, "oid8", fcinfo->context);
34 PG_RETURN_OID8(result);
35}
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:278
#define PG_RETURN_OID8(x)
Definition: fmgr.h:362
uint64 uint64in_subr(const char *s, char **endloc, const char *typname, Node *escontext)
Definition: numutils.c:985

References PG_GETARG_CSTRING, PG_RETURN_OID8, and uint64in_subr().

◆ oid8larger()

Datum oid8larger ( PG_FUNCTION_ARGS  )

Definition at line 153 of file oid8.c.

154{
155 Oid8 arg1 = PG_GETARG_OID8(0);
156 Oid8 arg2 = PG_GETARG_OID8(1);
157
158 PG_RETURN_OID8((arg1 > arg2) ? arg1 : arg2);
159}

References PG_GETARG_OID8, and PG_RETURN_OID8.

◆ oid8le()

Datum oid8le ( PG_FUNCTION_ARGS  )

Definition at line 114 of file oid8.c.

115{
116 Oid8 arg1 = PG_GETARG_OID8(0);
117 Oid8 arg2 = PG_GETARG_OID8(1);
118
119 PG_RETURN_BOOL(arg1 <= arg2);
120}

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8lt()

Datum oid8lt ( PG_FUNCTION_ARGS  )

Definition at line 105 of file oid8.c.

106{
107 Oid8 arg1 = PG_GETARG_OID8(0);
108 Oid8 arg2 = PG_GETARG_OID8(1);
109
110 PG_RETURN_BOOL(arg1 < arg2);
111}

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8ne()

Datum oid8ne ( PG_FUNCTION_ARGS  )

Definition at line 96 of file oid8.c.

97{
98 Oid8 arg1 = PG_GETARG_OID8(0);
99 Oid8 arg2 = PG_GETARG_OID8(1);
100
101 PG_RETURN_BOOL(arg1 != arg2);
102}

References PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8out()

Datum oid8out ( PG_FUNCTION_ARGS  )

Definition at line 38 of file oid8.c.

39{
41 char buf[MAXOID8LEN + 1];
42 char *result;
43 int len;
44
45 len = pg_ulltoa_n(val, buf) + 1;
46 buf[len - 1] = '\0';
47
48 /*
49 * Since the length is already known, we do a manual palloc() and memcpy()
50 * to avoid the strlen() call that would otherwise be done in pstrdup().
51 */
52 result = palloc(len);
53 memcpy(result, buf, len);
54 PG_RETURN_CSTRING(result);
55}
#define PG_RETURN_CSTRING(x)
Definition: fmgr.h:364
long val
Definition: informix.c:689
void * palloc(Size size)
Definition: mcxt.c:1387
int pg_ulltoa_n(uint64 value, char *a)
Definition: numutils.c:1140
#define MAXOID8LEN
Definition: oid8.c:21
const void size_t len
static char buf[DEFAULT_XLOG_SEG_SIZE]
Definition: pg_test_fsync.c:71

References buf, len, MAXOID8LEN, palloc(), PG_GETARG_OID8, PG_RETURN_CSTRING, pg_ulltoa_n(), and val.

◆ oid8recv()

Datum oid8recv ( PG_FUNCTION_ARGS  )

Definition at line 61 of file oid8.c.

62{
64
66}
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:277
int64 pq_getmsgint64(StringInfo msg)
Definition: pqformat.c:452
struct StringInfoData * StringInfo
Definition: string.h:15

References buf, PG_GETARG_POINTER, PG_RETURN_OID8, and pq_getmsgint64().

◆ oid8send()

Datum oid8send ( PG_FUNCTION_ARGS  )

Definition at line 72 of file oid8.c.

73{
74 Oid8 arg1 = PG_GETARG_OID8(0);
76
78 pq_sendint64(&buf, arg1);
80}
#define PG_RETURN_BYTEA_P(x)
Definition: fmgr.h:373
void pq_begintypsend(StringInfo buf)
Definition: pqformat.c:325
bytea * pq_endtypsend(StringInfo buf)
Definition: pqformat.c:345
static void pq_sendint64(StringInfo buf, uint64 i)
Definition: pqformat.h:152

References buf, PG_GETARG_OID8, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint64().

◆ oid8smaller()

Datum oid8smaller ( PG_FUNCTION_ARGS  )

Definition at line 162 of file oid8.c.

163{
164 Oid8 arg1 = PG_GETARG_OID8(0);
165 Oid8 arg2 = PG_GETARG_OID8(1);
166
167 PG_RETURN_OID8((arg1 < arg2) ? arg1 : arg2);
168}

References PG_GETARG_OID8, and PG_RETURN_OID8.