PostgreSQL Source Code  git master
pseudotypes.c File Reference
#include "postgres.h"
#include "libpq/pqformat.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/rangetypes.h"
#include "utils/multirangetypes.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:858
int errmsg(const char *fmt,...)
Definition: elog.c:1069
#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:71

Definition at line 84 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 37 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:37

Definition at line 50 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 71 of file pseudotypes.c.

Function Documentation

◆ anyarray_out()

Datum anyarray_out ( PG_FUNCTION_ARGS  )

Definition at line 161 of file pseudotypes.c.

162 {
163  return array_out(fcinfo);
164 }
Datum array_out(PG_FUNCTION_ARGS)
Definition: arrayfuncs.c:1017

References array_out().

◆ anyarray_send()

Datum anyarray_send ( PG_FUNCTION_ARGS  )

Definition at line 167 of file pseudotypes.c.

168 {
169  return array_send(fcinfo);
170 }
Datum array_send(PG_FUNCTION_ARGS)
Definition: arrayfuncs.c:1549

References array_send().

◆ anycompatiblearray_out()

Datum anycompatiblearray_out ( PG_FUNCTION_ARGS  )

Definition at line 181 of file pseudotypes.c.

182 {
183  return array_out(fcinfo);
184 }

References array_out().

◆ anycompatiblearray_send()

Datum anycompatiblearray_send ( PG_FUNCTION_ARGS  )

Definition at line 187 of file pseudotypes.c.

188 {
189  return array_send(fcinfo);
190 }

References array_send().

◆ anycompatiblemultirange_out()

Datum anycompatiblemultirange_out ( PG_FUNCTION_ARGS  )

Definition at line 252 of file pseudotypes.c.

253 {
254  return multirange_out(fcinfo);
255 }
Datum multirange_out(PG_FUNCTION_ARGS)

References multirange_out().

◆ anycompatiblerange_out()

Datum anycompatiblerange_out ( PG_FUNCTION_ARGS  )

Definition at line 226 of file pseudotypes.c.

227 {
228  return range_out(fcinfo);
229 }
Datum range_out(PG_FUNCTION_ARGS)
Definition: rangetypes.c:130

References range_out().

◆ anyenum_out()

Datum anyenum_out ( PG_FUNCTION_ARGS  )

Definition at line 200 of file pseudotypes.c.

201 {
202  return enum_out(fcinfo);
203 }
Datum enum_out(PG_FUNCTION_ARGS)
Definition: enum.c:155

References enum_out().

◆ anymultirange_out()

Datum anymultirange_out ( PG_FUNCTION_ARGS  )

Definition at line 239 of file pseudotypes.c.

240 {
241  return multirange_out(fcinfo);
242 }

References multirange_out().

◆ anyrange_out()

Datum anyrange_out ( PG_FUNCTION_ARGS  )

Definition at line 213 of file pseudotypes.c.

214 {
215  return range_out(fcinfo);
216 }

References range_out().

◆ cstring_in()

Datum cstring_in ( PG_FUNCTION_ARGS  )

Definition at line 110 of file pseudotypes.c.

111 {
112  char *str = PG_GETARG_CSTRING(0);
113 
115 }
#define PG_RETURN_CSTRING(x)
Definition: fmgr.h:362
#define PG_GETARG_CSTRING(n)
Definition: fmgr.h:277
char * pstrdup(const char *in)
Definition: mcxt.c:1644

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

◆ cstring_out()

Datum cstring_out ( PG_FUNCTION_ARGS  )

Definition at line 118 of file pseudotypes.c.

119 {
120  char *str = PG_GETARG_CSTRING(0);
121 
123 }

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

◆ cstring_recv()

Datum cstring_recv ( PG_FUNCTION_ARGS  )

Definition at line 126 of file pseudotypes.c.

127 {
129  char *str;
130  int nbytes;
131 
132  str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
134 }
#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:549
StringInfoData * StringInfo
Definition: stringinfo.h:54

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

◆ cstring_send()

Datum cstring_send ( PG_FUNCTION_ARGS  )

Definition at line 137 of file pseudotypes.c.

138 {
139  char *str = PG_GETARG_CSTRING(0);
141 
143  pq_sendtext(&buf, str, strlen(str));
145 }
#define PG_RETURN_BYTEA_P(x)
Definition: fmgr.h:371
void pq_sendtext(StringInfo buf, const char *str, int slen)
Definition: pqformat.c:175
void pq_begintypsend(StringInfo buf)
Definition: pqformat.c:329
bytea * pq_endtypsend(StringInfo buf)
Definition: pqformat.c:349

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

◆ pg_node_tree_out()

Datum pg_node_tree_out ( PG_FUNCTION_ARGS  )

Definition at line 341 of file pseudotypes.c.

342 {
343  return textout(fcinfo);
344 }
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 347 of file pseudotypes.c.

348 {
349  return textsend(fcinfo);
350 }
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 306 of file pseudotypes.c.

307 {
308  ereport(ERROR,
309  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
310  errmsg("cannot accept a value of a shell type")));
311 
312  PG_RETURN_VOID(); /* keep compiler quiet */
313 }
#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 316 of file pseudotypes.c.

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

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

◆ void_in()

Datum void_in ( PG_FUNCTION_ARGS  )

Definition at line 266 of file pseudotypes.c.

267 {
268  PG_RETURN_VOID(); /* you were expecting something different? */
269 }

References PG_RETURN_VOID.

◆ void_out()

Datum void_out ( PG_FUNCTION_ARGS  )

Definition at line 272 of file pseudotypes.c.

273 {
275 }

References PG_RETURN_CSTRING, and pstrdup().

◆ void_recv()

Datum void_recv ( PG_FUNCTION_ARGS  )

Definition at line 278 of file pseudotypes.c.

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

References PG_RETURN_VOID.

◆ void_send()

Datum void_send ( PG_FUNCTION_ARGS  )

Definition at line 288 of file pseudotypes.c.

289 {
291 
292  /* send an empty string */
295 }

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