9
9
* Portions Copyright (c) 1994, Regents of the University of California
10
10
*
11
11
* IDENTIFICATION
12
- * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.89 2005/04/23 17:45:35 tgl Exp $
12
+ * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.90 2005/05/01 18:56:17 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -48,7 +48,6 @@ typedef struct
48
48
{ /* Per-attribute information */
49
49
Oid typoutput ; /* Oid for the type's text output fn */
50
50
Oid typsend ; /* Oid for the type's binary output fn */
51
- Oid typioparam ; /* param to pass to the output fn */
52
51
bool typisvarlena ; /* is it varlena (ie possibly toastable)? */
53
52
int16 format ; /* format code for this column */
54
53
FmgrInfo finfo ; /* Precomputed call info for output fn */
@@ -263,15 +262,13 @@ printtup_prepare_info(DR_printtup *myState, TupleDesc typeinfo, int numAttrs)
263
262
{
264
263
getTypeOutputInfo (typeinfo -> attrs [i ]-> atttypid ,
265
264
& thisState -> typoutput ,
266
- & thisState -> typioparam ,
267
265
& thisState -> typisvarlena );
268
266
fmgr_info (thisState -> typoutput , & thisState -> finfo );
269
267
}
270
268
else if (format == 1 )
271
269
{
272
270
getTypeBinaryOutputInfo (typeinfo -> attrs [i ]-> atttypid ,
273
271
& thisState -> typsend ,
274
- & thisState -> typioparam ,
275
272
& thisState -> typisvarlena );
276
273
fmgr_info (thisState -> typsend , & thisState -> finfo );
277
274
}
@@ -338,10 +335,8 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
338
335
/* Text output */
339
336
char * outputstr ;
340
337
341
- outputstr = DatumGetCString (FunctionCall3 (& thisState -> finfo ,
342
- attr ,
343
- ObjectIdGetDatum (thisState -> typioparam ),
344
- Int32GetDatum (typeinfo -> attrs [i ]-> atttypmod )));
338
+ outputstr = DatumGetCString (FunctionCall1 (& thisState -> finfo ,
339
+ attr ));
345
340
pq_sendcountedtext (& buf , outputstr , strlen (outputstr ), false);
346
341
pfree (outputstr );
347
342
}
@@ -350,9 +345,8 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
350
345
/* Binary output */
351
346
bytea * outputbytes ;
352
347
353
- outputbytes = DatumGetByteaP (FunctionCall2 (& thisState -> finfo ,
354
- attr ,
355
- ObjectIdGetDatum (thisState -> typioparam )));
348
+ outputbytes = DatumGetByteaP (FunctionCall1 (& thisState -> finfo ,
349
+ attr ));
356
350
/* We assume the result will not have been toasted */
357
351
pq_sendint (& buf , VARSIZE (outputbytes ) - VARHDRSZ , 4 );
358
352
pq_sendbytes (& buf , VARDATA (outputbytes ),
@@ -439,10 +433,8 @@ printtup_20(TupleTableSlot *slot, DestReceiver *self)
439
433
else
440
434
attr = origattr ;
441
435
442
- outputstr = DatumGetCString (FunctionCall3 (& thisState -> finfo ,
443
- attr ,
444
- ObjectIdGetDatum (thisState -> typioparam ),
445
- Int32GetDatum (typeinfo -> attrs [i ]-> atttypmod )));
436
+ outputstr = DatumGetCString (FunctionCall1 (& thisState -> finfo ,
437
+ attr ));
446
438
pq_sendcountedtext (& buf , outputstr , strlen (outputstr ), true);
447
439
pfree (outputstr );
448
440
@@ -534,8 +526,7 @@ debugtup(TupleTableSlot *slot, DestReceiver *self)
534
526
attr ;
535
527
char * value ;
536
528
bool isnull ;
537
- Oid typoutput ,
538
- typioparam ;
529
+ Oid typoutput ;
539
530
bool typisvarlena ;
540
531
541
532
for (i = 0 ; i < natts ; ++ i )
@@ -544,7 +535,7 @@ debugtup(TupleTableSlot *slot, DestReceiver *self)
544
535
if (isnull )
545
536
continue ;
546
537
getTypeOutputInfo (typeinfo -> attrs [i ]-> atttypid ,
547
- & typoutput , & typioparam , & typisvarlena );
538
+ & typoutput , & typisvarlena );
548
539
549
540
/*
550
541
* If we have a toasted datum, forcibly detoast it here to avoid
@@ -555,10 +546,8 @@ debugtup(TupleTableSlot *slot, DestReceiver *self)
555
546
else
556
547
attr = origattr ;
557
548
558
- value = DatumGetCString (OidFunctionCall3 (typoutput ,
559
- attr ,
560
- ObjectIdGetDatum (typioparam ),
561
- Int32GetDatum (typeinfo -> attrs [i ]-> atttypmod )));
549
+ value = DatumGetCString (OidFunctionCall1 (typoutput ,
550
+ attr ));
562
551
563
552
printatt ((unsigned ) i + 1 , typeinfo -> attrs [i ], value );
564
553
@@ -647,9 +636,8 @@ printtup_internal_20(TupleTableSlot *slot, DestReceiver *self)
647
636
else
648
637
attr = origattr ;
649
638
650
- outputbytes = DatumGetByteaP (FunctionCall2 (& thisState -> finfo ,
651
- attr ,
652
- ObjectIdGetDatum (thisState -> typioparam )));
639
+ outputbytes = DatumGetByteaP (FunctionCall1 (& thisState -> finfo ,
640
+ attr ));
653
641
/* We assume the result will not have been toasted */
654
642
pq_sendint (& buf , VARSIZE (outputbytes ) - VARHDRSZ , 4 );
655
643
pq_sendbytes (& buf , VARDATA (outputbytes ),
0 commit comments