00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "postgres.h"
00024
00025 #include "libpq/pqformat.h"
00026 #include "utils/array.h"
00027 #include "utils/builtins.h"
00028 #include "utils/rangetypes.h"
00029
00030
00031
00032
00033
00034
00035
00036 Datum
00037 cstring_in(PG_FUNCTION_ARGS)
00038 {
00039 char *str = PG_GETARG_CSTRING(0);
00040
00041 PG_RETURN_CSTRING(pstrdup(str));
00042 }
00043
00044
00045
00046
00047
00048
00049
00050 Datum
00051 cstring_out(PG_FUNCTION_ARGS)
00052 {
00053 char *str = PG_GETARG_CSTRING(0);
00054
00055 PG_RETURN_CSTRING(pstrdup(str));
00056 }
00057
00058
00059
00060
00061 Datum
00062 cstring_recv(PG_FUNCTION_ARGS)
00063 {
00064 StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
00065 char *str;
00066 int nbytes;
00067
00068 str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
00069 PG_RETURN_CSTRING(str);
00070 }
00071
00072
00073
00074
00075 Datum
00076 cstring_send(PG_FUNCTION_ARGS)
00077 {
00078 char *str = PG_GETARG_CSTRING(0);
00079 StringInfoData buf;
00080
00081 pq_begintypsend(&buf);
00082 pq_sendtext(&buf, str, strlen(str));
00083 PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
00084 }
00085
00086
00087
00088
00089
00090 Datum
00091 any_in(PG_FUNCTION_ARGS)
00092 {
00093 ereport(ERROR,
00094 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00095 errmsg("cannot accept a value of type any")));
00096
00097 PG_RETURN_VOID();
00098 }
00099
00100
00101
00102
00103 Datum
00104 any_out(PG_FUNCTION_ARGS)
00105 {
00106 ereport(ERROR,
00107 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00108 errmsg("cannot display a value of type any")));
00109
00110 PG_RETURN_VOID();
00111 }
00112
00113
00114
00115
00116
00117 Datum
00118 anyarray_in(PG_FUNCTION_ARGS)
00119 {
00120 ereport(ERROR,
00121 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00122 errmsg("cannot accept a value of type anyarray")));
00123
00124 PG_RETURN_VOID();
00125 }
00126
00127
00128
00129
00130
00131
00132 Datum
00133 anyarray_out(PG_FUNCTION_ARGS)
00134 {
00135 return array_out(fcinfo);
00136 }
00137
00138
00139
00140
00141
00142
00143
00144
00145 Datum
00146 anyarray_recv(PG_FUNCTION_ARGS)
00147 {
00148 ereport(ERROR,
00149 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00150 errmsg("cannot accept a value of type anyarray")));
00151
00152 PG_RETURN_VOID();
00153 }
00154
00155
00156
00157
00158
00159
00160 Datum
00161 anyarray_send(PG_FUNCTION_ARGS)
00162 {
00163 return array_send(fcinfo);
00164 }
00165
00166
00167
00168
00169
00170 Datum
00171 anyenum_in(PG_FUNCTION_ARGS)
00172 {
00173 ereport(ERROR,
00174 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00175 errmsg("cannot accept a value of type anyenum")));
00176
00177 PG_RETURN_VOID();
00178 }
00179
00180
00181
00182
00183
00184
00185 Datum
00186 anyenum_out(PG_FUNCTION_ARGS)
00187 {
00188 return enum_out(fcinfo);
00189 }
00190
00191
00192
00193
00194 Datum
00195 anyrange_in(PG_FUNCTION_ARGS)
00196 {
00197 ereport(ERROR,
00198 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00199 errmsg("cannot accept a value of type anyrange")));
00200
00201 PG_RETURN_VOID();
00202 }
00203
00204
00205
00206
00207
00208
00209 Datum
00210 anyrange_out(PG_FUNCTION_ARGS)
00211 {
00212 return range_out(fcinfo);
00213 }
00214
00215
00216
00217
00218
00219
00220
00221
00222 Datum
00223 void_in(PG_FUNCTION_ARGS)
00224 {
00225 PG_RETURN_VOID();
00226 }
00227
00228
00229
00230
00231
00232
00233 Datum
00234 void_out(PG_FUNCTION_ARGS)
00235 {
00236 PG_RETURN_CSTRING(pstrdup(""));
00237 }
00238
00239
00240
00241
00242
00243
00244
00245 Datum
00246 void_recv(PG_FUNCTION_ARGS)
00247 {
00248 PG_RETURN_VOID();
00249 }
00250
00251
00252
00253
00254
00255
00256
00257 Datum
00258 void_send(PG_FUNCTION_ARGS)
00259 {
00260 StringInfoData buf;
00261
00262
00263 pq_begintypsend(&buf);
00264 PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
00265 }
00266
00267
00268
00269
00270
00271 Datum
00272 trigger_in(PG_FUNCTION_ARGS)
00273 {
00274 ereport(ERROR,
00275 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00276 errmsg("cannot accept a value of type trigger")));
00277
00278 PG_RETURN_VOID();
00279 }
00280
00281
00282
00283
00284 Datum
00285 trigger_out(PG_FUNCTION_ARGS)
00286 {
00287 ereport(ERROR,
00288 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00289 errmsg("cannot display a value of type trigger")));
00290
00291 PG_RETURN_VOID();
00292 }
00293
00294
00295
00296
00297
00298 Datum
00299 event_trigger_in(PG_FUNCTION_ARGS)
00300 {
00301 ereport(ERROR,
00302 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00303 errmsg("cannot accept a value of type event_trigger")));
00304
00305 PG_RETURN_VOID();
00306 }
00307
00308
00309
00310
00311 Datum
00312 event_trigger_out(PG_FUNCTION_ARGS)
00313 {
00314 ereport(ERROR,
00315 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00316 errmsg("cannot display a value of type event_trigger")));
00317
00318 PG_RETURN_VOID();
00319 }
00320
00321
00322
00323
00324
00325 Datum
00326 language_handler_in(PG_FUNCTION_ARGS)
00327 {
00328 ereport(ERROR,
00329 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00330 errmsg("cannot accept a value of type language_handler")));
00331
00332 PG_RETURN_VOID();
00333 }
00334
00335
00336
00337
00338 Datum
00339 language_handler_out(PG_FUNCTION_ARGS)
00340 {
00341 ereport(ERROR,
00342 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00343 errmsg("cannot display a value of type language_handler")));
00344
00345 PG_RETURN_VOID();
00346 }
00347
00348
00349
00350
00351
00352 Datum
00353 fdw_handler_in(PG_FUNCTION_ARGS)
00354 {
00355 ereport(ERROR,
00356 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00357 errmsg("cannot accept a value of type fdw_handler")));
00358
00359 PG_RETURN_VOID();
00360 }
00361
00362
00363
00364
00365 Datum
00366 fdw_handler_out(PG_FUNCTION_ARGS)
00367 {
00368 ereport(ERROR,
00369 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00370 errmsg("cannot display a value of type fdw_handler")));
00371
00372 PG_RETURN_VOID();
00373 }
00374
00375
00376
00377
00378
00379 Datum
00380 internal_in(PG_FUNCTION_ARGS)
00381 {
00382 ereport(ERROR,
00383 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00384 errmsg("cannot accept a value of type internal")));
00385
00386 PG_RETURN_VOID();
00387 }
00388
00389
00390
00391
00392 Datum
00393 internal_out(PG_FUNCTION_ARGS)
00394 {
00395 ereport(ERROR,
00396 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00397 errmsg("cannot display a value of type internal")));
00398
00399 PG_RETURN_VOID();
00400 }
00401
00402
00403
00404
00405
00406 Datum
00407 opaque_in(PG_FUNCTION_ARGS)
00408 {
00409 ereport(ERROR,
00410 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00411 errmsg("cannot accept a value of type opaque")));
00412
00413 PG_RETURN_VOID();
00414 }
00415
00416
00417
00418
00419 Datum
00420 opaque_out(PG_FUNCTION_ARGS)
00421 {
00422 ereport(ERROR,
00423 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00424 errmsg("cannot display a value of type opaque")));
00425
00426 PG_RETURN_VOID();
00427 }
00428
00429
00430
00431
00432
00433 Datum
00434 anyelement_in(PG_FUNCTION_ARGS)
00435 {
00436 ereport(ERROR,
00437 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00438 errmsg("cannot accept a value of type anyelement")));
00439
00440 PG_RETURN_VOID();
00441 }
00442
00443
00444
00445
00446 Datum
00447 anyelement_out(PG_FUNCTION_ARGS)
00448 {
00449 ereport(ERROR,
00450 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00451 errmsg("cannot display a value of type anyelement")));
00452
00453 PG_RETURN_VOID();
00454 }
00455
00456
00457
00458
00459 Datum
00460 anynonarray_in(PG_FUNCTION_ARGS)
00461 {
00462 ereport(ERROR,
00463 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00464 errmsg("cannot accept a value of type anynonarray")));
00465
00466 PG_RETURN_VOID();
00467 }
00468
00469
00470
00471
00472 Datum
00473 anynonarray_out(PG_FUNCTION_ARGS)
00474 {
00475 ereport(ERROR,
00476 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00477 errmsg("cannot display a value of type anynonarray")));
00478
00479 PG_RETURN_VOID();
00480 }
00481
00482
00483
00484
00485 Datum
00486 shell_in(PG_FUNCTION_ARGS)
00487 {
00488 ereport(ERROR,
00489 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00490 errmsg("cannot accept a value of a shell type")));
00491
00492 PG_RETURN_VOID();
00493 }
00494
00495
00496
00497
00498 Datum
00499 shell_out(PG_FUNCTION_ARGS)
00500 {
00501 ereport(ERROR,
00502 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00503 errmsg("cannot display a value of a shell type")));
00504
00505 PG_RETURN_VOID();
00506 }
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516 Datum
00517 pg_node_tree_in(PG_FUNCTION_ARGS)
00518 {
00519
00520
00521
00522
00523 ereport(ERROR,
00524 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00525 errmsg("cannot accept a value of type pg_node_tree")));
00526
00527 PG_RETURN_VOID();
00528 }
00529
00530
00531
00532
00533
00534
00535 Datum
00536 pg_node_tree_out(PG_FUNCTION_ARGS)
00537 {
00538 return textout(fcinfo);
00539 }
00540
00541
00542
00543
00544 Datum
00545 pg_node_tree_recv(PG_FUNCTION_ARGS)
00546 {
00547 ereport(ERROR,
00548 (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
00549 errmsg("cannot accept a value of type pg_node_tree")));
00550
00551 PG_RETURN_VOID();
00552 }
00553
00554
00555
00556
00557 Datum
00558 pg_node_tree_send(PG_FUNCTION_ARGS)
00559 {
00560 return textsend(fcinfo);
00561 }