PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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{
91
93}
uint64 Oid8
Definition c.h:686
#define PG_GETARG_OID8(n)
Definition fmgr.h:276
#define PG_RETURN_BOOL(x)
Definition fmgr.h:360
static int fb(int x)

References fb(), PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8ge()

Datum oid8ge ( PG_FUNCTION_ARGS  )

Definition at line 123 of file oid8.c.

124{
127
129}

References fb(), PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8gt()

Datum oid8gt ( PG_FUNCTION_ARGS  )

Definition at line 132 of file oid8.c.

133{
136
138}

References fb(), 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:984

References fb(), PG_GETARG_CSTRING, PG_RETURN_OID8, and uint64in_subr().

◆ oid8larger()

Datum oid8larger ( PG_FUNCTION_ARGS  )

Definition at line 153 of file oid8.c.

154{
157
159}

References fb(), PG_GETARG_OID8, and PG_RETURN_OID8.

◆ oid8le()

Datum oid8le ( PG_FUNCTION_ARGS  )

Definition at line 114 of file oid8.c.

115{
118
120}

References fb(), PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8lt()

Datum oid8lt ( PG_FUNCTION_ARGS  )

Definition at line 105 of file oid8.c.

106{
109
111}

References fb(), PG_GETARG_OID8, and PG_RETURN_BOOL.

◆ oid8ne()

Datum oid8ne ( PG_FUNCTION_ARGS  )

Definition at line 96 of file oid8.c.

97{
100
102}

References fb(), 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:1139
#define MAXOID8LEN
Definition oid8.c:21
const void size_t len
static char buf[DEFAULT_XLOG_SEG_SIZE]

References buf, fb(), 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{
76
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, fb(), 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{
166
168}

References fb(), PG_GETARG_OID8, and PG_RETURN_OID8.