PostgreSQL Source Code  git master
pseudotypes.c File Reference
#include "postgres.h"
#include "libpq/pqformat.h"
#include "utils/fmgrprotos.h"
Include dependency graph for pseudotypes.c:

Go to the source code of this file.

Macros

#define PSEUDOTYPE_DUMMY_INPUT_FUNC(typname)
 
#define PSEUDOTYPE_DUMMY_IO_FUNCS(typname)
 
#define PSEUDOTYPE_DUMMY_RECEIVE_FUNC(typname)
 
#define PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS(typname)
 

Functions

Datum cstring_in (PG_FUNCTION_ARGS)
 
Datum cstring_out (PG_FUNCTION_ARGS)
 
Datum cstring_recv (PG_FUNCTION_ARGS)
 
Datum cstring_send (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anyarray)
 
 PSEUDOTYPE_DUMMY_RECEIVE_FUNC (anyarray)
 
Datum anyarray_out (PG_FUNCTION_ARGS)
 
Datum anyarray_send (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anycompatiblearray)
 
 PSEUDOTYPE_DUMMY_RECEIVE_FUNC (anycompatiblearray)
 
Datum anycompatiblearray_out (PG_FUNCTION_ARGS)
 
Datum anycompatiblearray_send (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anyenum)
 
Datum anyenum_out (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anyrange)
 
Datum anyrange_out (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anycompatiblerange)
 
Datum anycompatiblerange_out (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anymultirange)
 
Datum anymultirange_out (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (anycompatiblemultirange)
 
Datum anycompatiblemultirange_out (PG_FUNCTION_ARGS)
 
Datum void_in (PG_FUNCTION_ARGS)
 
Datum void_out (PG_FUNCTION_ARGS)
 
Datum void_recv (PG_FUNCTION_ARGS)
 
Datum void_send (PG_FUNCTION_ARGS)
 
Datum shell_in (PG_FUNCTION_ARGS)
 
Datum shell_out (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_INPUT_FUNC (pg_node_tree)
 
 PSEUDOTYPE_DUMMY_RECEIVE_FUNC (pg_node_tree)
 
Datum pg_node_tree_out (PG_FUNCTION_ARGS)
 
Datum pg_node_tree_send (PG_FUNCTION_ARGS)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (pg_ddl_command)
 
 PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS (pg_ddl_command)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (any)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (trigger)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (event_trigger)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (language_handler)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (fdw_handler)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (table_am_handler)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (index_am_handler)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (tsm_handler)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (internal)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (anyelement)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (anynonarray)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (anycompatible)
 
 PSEUDOTYPE_DUMMY_IO_FUNCS (anycompatiblenonarray)
 

Macro Definition Documentation

◆ PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS

#define PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS (   typname)
Value:
\
Datum \
typname##_send(PG_FUNCTION_ARGS) \
{ \
ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
errmsg("cannot display a value of type %s", #typname))); \
PG_RETURN_VOID(); /* keep compiler quiet */ \
} \
\
extern int no_such_variable
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ERROR
Definition: elog.h:39
#define PG_RETURN_VOID()
Definition: fmgr.h:349
#define PG_FUNCTION_ARGS
Definition: fmgr.h:193
NameData typname
Definition: pg_type.h:41
#define PSEUDOTYPE_DUMMY_RECEIVE_FUNC(typname)
Definition: pseudotypes.c:68

Definition at line 81 of file pseudotypes.c.

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC

#define PSEUDOTYPE_DUMMY_INPUT_FUNC (   typname)
Value:
Datum \
typname##_in(PG_FUNCTION_ARGS) \
{ \
ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
errmsg("cannot accept a value of type %s", #typname))); \
PG_RETURN_VOID(); /* keep compiler quiet */ \
} \
\
extern int no_such_variable

Definition at line 34 of file pseudotypes.c.

◆ PSEUDOTYPE_DUMMY_IO_FUNCS

#define PSEUDOTYPE_DUMMY_IO_FUNCS (   typname)
Value:
\
Datum \
typname##_out(PG_FUNCTION_ARGS) \
{ \
ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
errmsg("cannot display a value of type %s", #typname))); \
PG_RETURN_VOID(); /* keep compiler quiet */ \
} \
\
extern int no_such_variable
#define PSEUDOTYPE_DUMMY_INPUT_FUNC(typname)
Definition: pseudotypes.c:34

Definition at line 47 of file pseudotypes.c.

◆ PSEUDOTYPE_DUMMY_RECEIVE_FUNC

#define PSEUDOTYPE_DUMMY_RECEIVE_FUNC (   typname)
Value:
Datum \
typname##_recv(PG_FUNCTION_ARGS) \
{ \
ereport(ERROR, \
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
errmsg("cannot accept a value of type %s", #typname))); \
PG_RETURN_VOID(); /* keep compiler quiet */ \
} \
\
extern int no_such_variable

Definition at line 68 of file pseudotypes.c.

Function Documentation

◆ anyarray_out()

Datum anyarray_out ( PG_FUNCTION_ARGS  )

Definition at line 158 of file pseudotypes.c.

159 {
160  return array_out(fcinfo);
161 }
Datum array_out(PG_FUNCTION_ARGS)
Definition: arrayfuncs.c:1016

References array_out().

◆ anyarray_send()

Datum anyarray_send ( PG_FUNCTION_ARGS  )

Definition at line 164 of file pseudotypes.c.

165 {
166  return array_send(fcinfo);
167 }
Datum array_send(PG_FUNCTION_ARGS)
Definition: arrayfuncs.c:1548

References array_send().

◆ anycompatiblearray_out()

Datum anycompatiblearray_out ( PG_FUNCTION_ARGS  )

Definition at line 178 of file pseudotypes.c.

179 {
180  return array_out(fcinfo);
181 }

References array_out().

◆ anycompatiblearray_send()

Datum anycompatiblearray_send ( PG_FUNCTION_ARGS  )

Definition at line 184 of file pseudotypes.c.

185 {
186  return array_send(fcinfo);
187 }

References array_send().

◆ anycompatiblemultirange_out()

Datum anycompatiblemultirange_out ( PG_FUNCTION_ARGS  )

Definition at line 249 of file pseudotypes.c.

250 {
251  return multirange_out(fcinfo);
252 }
Datum multirange_out(PG_FUNCTION_ARGS)

References multirange_out().

◆ anycompatiblerange_out()

Datum anycompatiblerange_out ( PG_FUNCTION_ARGS  )

Definition at line 223 of file pseudotypes.c.

224 {
225  return range_out(fcinfo);
226 }
Datum range_out(PG_FUNCTION_ARGS)
Definition: rangetypes.c:137

References range_out().

◆ anyenum_out()

Datum anyenum_out ( PG_FUNCTION_ARGS  )

Definition at line 197 of file pseudotypes.c.

198 {
199  return enum_out(fcinfo);
200 }
Datum enum_out(PG_FUNCTION_ARGS)
Definition: enum.c:155

References enum_out().

◆ anymultirange_out()

Datum anymultirange_out ( PG_FUNCTION_ARGS  )

Definition at line 236 of file pseudotypes.c.

237 {
238  return multirange_out(fcinfo);
239 }

References multirange_out().

◆ anyrange_out()

Datum anyrange_out ( PG_FUNCTION_ARGS  )

Definition at line 210 of file pseudotypes.c.

211 {
212  return range_out(fcinfo);
213 }

References range_out().

◆ cstring_in()

Datum cstring_in ( PG_FUNCTION_ARGS  )

Definition at line 107 of file pseudotypes.c.

108 {
109  char *str = PG_GETARG_CSTRING(0);
110 
112 }
#define PG_RETURN_CSTRING(x)
Definition: fmgr.h:362
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:277
const char * str
char * pstrdup(const char *in)
Definition: mcxt.c:1696

References PG_GETARG_CSTRING, PG_RETURN_CSTRING, pstrdup(), and str.

◆ cstring_out()

Datum cstring_out ( PG_FUNCTION_ARGS  )

Definition at line 115 of file pseudotypes.c.

116 {
117  char *str = PG_GETARG_CSTRING(0);
118 
120 }

References PG_GETARG_CSTRING, PG_RETURN_CSTRING, pstrdup(), and str.

◆ cstring_recv()

Datum cstring_recv ( PG_FUNCTION_ARGS  )

Definition at line 123 of file pseudotypes.c.

124 {
126  char *str;
127  int nbytes;
128 
129  str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
131 }
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:276
static char * buf
Definition: pg_test_fsync.c:73
char * pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes)
Definition: pqformat.c:546
StringInfoData * StringInfo
Definition: stringinfo.h:54

References buf, PG_GETARG_POINTER, PG_RETURN_CSTRING, pq_getmsgtext(), and str.

◆ cstring_send()

Datum cstring_send ( PG_FUNCTION_ARGS  )

Definition at line 134 of file pseudotypes.c.

135 {
136  char *str = PG_GETARG_CSTRING(0);
138 
140  pq_sendtext(&buf, str, strlen(str));
142 }
#define PG_RETURN_BYTEA_P(x)
Definition: fmgr.h:371
void pq_sendtext(StringInfo buf, const char *str, int slen)
Definition: pqformat.c:172
void pq_begintypsend(StringInfo buf)
Definition: pqformat.c:326
bytea * pq_endtypsend(StringInfo buf)
Definition: pqformat.c:346

References buf, PG_GETARG_CSTRING, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendtext(), and str.

◆ pg_node_tree_out()

Datum pg_node_tree_out ( PG_FUNCTION_ARGS  )

Definition at line 338 of file pseudotypes.c.

339 {
340  return textout(fcinfo);
341 }
Datum textout(PG_FUNCTION_ARGS)
Definition: varlena.c:590

References textout().

◆ pg_node_tree_send()

Datum pg_node_tree_send ( PG_FUNCTION_ARGS  )

Definition at line 344 of file pseudotypes.c.

345 {
346  return textsend(fcinfo);
347 }
Datum textsend(PG_FUNCTION_ARGS)
Definition: varlena.c:619

References textsend().

◆ PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS()

PSEUDOTYPE_DUMMY_BINARY_IO_FUNCS ( pg_ddl_command  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [1/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anyarray  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [2/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anycompatiblearray  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [3/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anycompatiblemultirange  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [4/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anycompatiblerange  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [5/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anyenum  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [6/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anymultirange  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [7/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( anyrange  )

◆ PSEUDOTYPE_DUMMY_INPUT_FUNC() [8/8]

PSEUDOTYPE_DUMMY_INPUT_FUNC ( pg_node_tree  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [1/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( any  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [2/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( anycompatible  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [3/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( anycompatiblenonarray  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [4/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( anyelement  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [5/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( anynonarray  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [6/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( event_trigger  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [7/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( fdw_handler  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [8/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( index_am_handler  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [9/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( internal  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [10/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( language_handler  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [11/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( pg_ddl_command  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [12/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( table_am_handler  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [13/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( trigger  )

◆ PSEUDOTYPE_DUMMY_IO_FUNCS() [14/14]

PSEUDOTYPE_DUMMY_IO_FUNCS ( tsm_handler  )

◆ PSEUDOTYPE_DUMMY_RECEIVE_FUNC() [1/3]

PSEUDOTYPE_DUMMY_RECEIVE_FUNC ( anyarray  )

◆ PSEUDOTYPE_DUMMY_RECEIVE_FUNC() [2/3]

PSEUDOTYPE_DUMMY_RECEIVE_FUNC ( anycompatiblearray  )

◆ PSEUDOTYPE_DUMMY_RECEIVE_FUNC() [3/3]

PSEUDOTYPE_DUMMY_RECEIVE_FUNC ( pg_node_tree  )

◆ shell_in()

Datum shell_in ( PG_FUNCTION_ARGS  )

Definition at line 303 of file pseudotypes.c.

304 {
305  ereport(ERROR,
306  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
307  errmsg("cannot accept a value of a shell type")));
308 
309  PG_RETURN_VOID(); /* keep compiler quiet */
310 }
#define ereport(elevel,...)
Definition: elog.h:149

References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.

◆ shell_out()

Datum shell_out ( PG_FUNCTION_ARGS  )

Definition at line 313 of file pseudotypes.c.

314 {
315  ereport(ERROR,
316  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
317  errmsg("cannot display a value of a shell type")));
318 
319  PG_RETURN_VOID(); /* keep compiler quiet */
320 }

References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.

◆ void_in()

Datum void_in ( PG_FUNCTION_ARGS  )

Definition at line 263 of file pseudotypes.c.

264 {
265  PG_RETURN_VOID(); /* you were expecting something different? */
266 }

References PG_RETURN_VOID.

◆ void_out()

Datum void_out ( PG_FUNCTION_ARGS  )

Definition at line 269 of file pseudotypes.c.

270 {
272 }

References PG_RETURN_CSTRING, and pstrdup().

◆ void_recv()

Datum void_recv ( PG_FUNCTION_ARGS  )

Definition at line 275 of file pseudotypes.c.

276 {
277  /*
278  * Note that since we consume no bytes, an attempt to send anything but an
279  * empty string will result in an "invalid message format" error.
280  */
281  PG_RETURN_VOID();
282 }

References PG_RETURN_VOID.

◆ void_send()

Datum void_send ( PG_FUNCTION_ARGS  )

Definition at line 285 of file pseudotypes.c.

286 {
288 
289  /* send an empty string */
292 }

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