#include #include "catalog/pg_type.h" #include "common/int.h" #include "libpq/pqformat.h" #include "nodes/miscnodes.h" #include "nodes/value.h" #include "utils/array.h" #include "utils/builtins.h"">

PostgreSQL Source Code: src/backend/utils/adt/oid.c File Reference (original) (raw)

#include "[postgres.h](postgres%5F8h%5Fsource.html)"
#include <ctype.h>
#include <limits.h>
#include "[catalog/pg_type.h](pg%5F%5Ftype%5F8h%5Fsource.html)"
#include "[common/int.h](int%5F8h%5Fsource.html)"
#include "[libpq/pqformat.h](pqformat%5F8h%5Fsource.html)"
#include "[nodes/miscnodes.h](miscnodes%5F8h%5Fsource.html)"
#include "[nodes/value.h](value%5F8h%5Fsource.html)"
#include "[utils/array.h](array%5F8h%5Fsource.html)"
#include "[utils/builtins.h](builtins%5F8h%5Fsource.html)"

Go to the source code of this file.

Functions
Datum oidin (PG_FUNCTION_ARGS)
Datum oidout (PG_FUNCTION_ARGS)
Datum oidrecv (PG_FUNCTION_ARGS)
Datum oidsend (PG_FUNCTION_ARGS)
oidvector * buildoidvector (const Oid *oids, int n)
Datum oidvectorin (PG_FUNCTION_ARGS)
Datum oidvectorout (PG_FUNCTION_ARGS)
Datum oidvectorrecv (PG_FUNCTION_ARGS)
Datum oidvectorsend (PG_FUNCTION_ARGS)
Oid oidparse (Node *node)
int oid_cmp (const void *p1, const void *p2)
Datum oideq (PG_FUNCTION_ARGS)
Datum oidne (PG_FUNCTION_ARGS)
Datum oidlt (PG_FUNCTION_ARGS)
Datum oidle (PG_FUNCTION_ARGS)
Datum oidge (PG_FUNCTION_ARGS)
Datum oidgt (PG_FUNCTION_ARGS)
Datum oidlarger (PG_FUNCTION_ARGS)
Datum oidsmaller (PG_FUNCTION_ARGS)
Datum oidvectoreq (PG_FUNCTION_ARGS)
Datum oidvectorne (PG_FUNCTION_ARGS)
Datum oidvectorlt (PG_FUNCTION_ARGS)
Datum oidvectorle (PG_FUNCTION_ARGS)
Datum oidvectorge (PG_FUNCTION_ARGS)
Datum oidvectorgt (PG_FUNCTION_ARGS)

OidVectorSize

Definition at line 29 of file oid.c.

buildoidvector()

Definition at line 87 of file oid.c.

88{

90

92

93 if (n > 0 && oids)

94 memcpy(result->values, oids, n * sizeof(Oid));

95

96

97

98

99

101 result->ndim = 1;

102 result->dataoffset = 0;

104 result->dim1 = n;

106

107 return result;

108}

void * palloc0(Size size)

Oid values[FLEXIBLE_ARRAY_MEMBER]

#define SET_VARSIZE(PTR, len)

References oidvector::dataoffset, oidvector::dim1, oidvector::elemtype, oidvector::lbound1, oidvector::ndim, OidVectorSize, palloc0(), SET_VARSIZE, and oidvector::values.

Referenced by DefineAggregate(), interpret_function_parameter_list(), makeMultirangeConstructors(), makeRangeConstructors(), StorePartitionKey(), and UpdateIndexRelation().

oid_cmp()

int oid_cmp ( const void * p1,
const void * p2
)

oideq()

oidge()

oidgt()

oidin()

oidlarger()

oidle()

oidlt()

oidne()

oidout()

oidparse()

Definition at line 235 of file oid.c.

236{

238 {

239 case T_Integer:

241 case T_Float:

242

243

244

245

246

247

249 "oid", NULL);

250 default:

251 elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));

252 }

253 return InvalidOid;

254}

#define castNode(_type_, nodeptr)

References castNode, elog, ERROR, intVal, InvalidOid, nodeTag, and uint32in_subr().

Referenced by get_object_address().

oidrecv()

Definition at line 60 of file oid.c.

61{

63

65}

#define PG_GETARG_POINTER(n)

unsigned int pq_getmsgint(StringInfo msg, int b)

StringInfoData * StringInfo

References buf, PG_GETARG_POINTER, PG_RETURN_OID, and pq_getmsgint().

Referenced by regclassrecv(), regcollationrecv(), regconfigrecv(), regdictionaryrecv(), regnamespacerecv(), regoperatorrecv(), regoperrecv(), regprocedurerecv(), regprocrecv(), regrolerecv(), and regtyperecv().

oidsend()

Definition at line 71 of file oid.c.

72{

75

79}

#define PG_RETURN_BYTEA_P(x)

void pq_begintypsend(StringInfo buf)

bytea * pq_endtypsend(StringInfo buf)

static void pq_sendint32(StringInfo buf, uint32 i)

References buf, PG_GETARG_OID, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint32().

Referenced by regclasssend(), regcollationsend(), regconfigsend(), regdictionarysend(), regnamespacesend(), regoperatorsend(), regopersend(), regproceduresend(), regprocsend(), regrolesend(), and regtypesend().

oidsmaller()

oidvectoreq()

oidvectorge()

oidvectorgt()

oidvectorin()

Definition at line 114 of file oid.c.

115{

117 Node *escontext = fcinfo->context;

119 int nalloc;

120 int n;

121

122 nalloc = 32;

124

125 for (n = 0;; n++)

126 {

127 while (*oidString && isspace((unsigned char) *oidString))

128 oidString++;

129 if (*oidString == '\0')

130 break;

131

132 if (n >= nalloc)

133 {

134 nalloc *= 2;

136 }

137

139 "oid", escontext);

142 }

143

145 result->ndim = 1;

146 result->dataoffset = 0;

148 result->dim1 = n;

150

152}

#define PG_RETURN_POINTER(x)

void * repalloc(void *pointer, Size size)

#define SOFT_ERROR_OCCURRED(escontext)

References oidvector::dataoffset, oidvector::dim1, oidvector::elemtype, oidvector::lbound1, oidvector::ndim, OidVectorSize, palloc0(), PG_GETARG_CSTRING, PG_RETURN_NULL, PG_RETURN_POINTER, repalloc(), SET_VARSIZE, SOFT_ERROR_OCCURRED, uint32in_subr(), and oidvector::values.

oidvectorle()

oidvectorlt()

oidvectorne()

oidvectorout()

oidvectorrecv()

Definition at line 184 of file oid.c.

185{

189

190

191

192

193

194

195

198

200 locfcinfo->args[0].isnull = false;

202 locfcinfo->args[1].isnull = false;

204 locfcinfo->args[2].isnull = false;

205

207

208 Assert(!locfcinfo->isnull);

209

210

216 (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),

217 errmsg("invalid oidvector data")));

218

220}

Datum array_recv(PG_FUNCTION_ARGS)

int errcode(int sqlerrcode)

int errmsg(const char *fmt,...)

#define ereport(elevel,...)

#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)

#define LOCAL_FCINFO(name, nargs)

Assert(PointerIsAligned(start, uint64))

static Datum PointerGetDatum(const void *X)

static Datum ObjectIdGetDatum(Oid X)

static Pointer DatumGetPointer(Datum X)

static Datum Int32GetDatum(int32 X)

References ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, array_recv(), Assert(), buf, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, InitFunctionCallInfoData, Int32GetDatum(), InvalidOid, LOCAL_FCINFO, ObjectIdGetDatum(), PG_GETARG_POINTER, PG_RETURN_POINTER, and PointerGetDatum().

oidvectorsend()

Definition at line 226 of file oid.c.

227{

229}

Datum array_send(PG_FUNCTION_ARGS)

References array_send().