8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/utils/adt/rowtypes.c,v 1.9 2005/04/18 17:11:05 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/utils/adt/rowtypes.c,v 1.10 2005/04/30 20:04:33 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -268,7 +268,7 @@ Datum
268
268
record_out (PG_FUNCTION_ARGS )
269
269
{
270
270
HeapTupleHeader rec = PG_GETARG_HEAPTUPLEHEADER (0 );
271
- Oid tup
8000
Type = PG_GETARG_OID ( 1 ) ;
271
+ Oid tupType ;
272
272
int32 tupTypmod ;
273
273
TupleDesc tupdesc ;
274
274
HeapTupleData tuple ;
@@ -280,18 +280,9 @@ record_out(PG_FUNCTION_ARGS)
280
280
char * nulls ;
281
281
StringInfoData buf ;
282
282
283
- /*
284
- * Use the passed type unless it's RECORD; in that case, we'd better
285
- * get the type info out of the datum itself. Note that for RECORD,
286
- * what we'll probably actually get is RECORD's typelem, ie, zero.
287
- */
288
- if (tupType == InvalidOid || tupType == RECORDOID )
289
- {
290
- tupType = HeapTupleHeaderGetTypeId (rec );
291
- tupTypmod = HeapTupleHeaderGetTypMod (rec );
292
- }
293
- else
294
- tupTypmod = -1 ;
283
+ /* Extract type info from the tuple itself */
284
+ tupType = HeapTupleHeaderGetTypeId (rec );
285
+ tupTypmod = HeapTupleHeaderGetTypMod (rec );
295
286
tupdesc = lookup_rowtype_tupdesc (tupType , tupTypmod );
296
287
ncolumns = tupdesc -> natts ;
297
288
@@ -613,7 +604,7 @@ Datum
613
604
record_send (PG_FUNCTION_ARGS )
614
605
{
615
606
HeapTupleHeader rec = PG_GETARG_HEAPTUPLEHEADER (0 );
616
- Oid tupType = PG_GETARG_OID ( 1 ) ;
607
+ Oid tupType ;
617
608
int32 tupTypmod ;
618
609
TupleDesc tupdesc ;
619
610
HeapTupleData tuple ;
@@ -625,18 +616,9 @@ record_send(PG_FUNCTION_ARGS)
625
616
char * nulls ;
626
617
StringInfoData buf ;
627
618
628
- /*
629
- * Use the passed type unless it's RECORD; in that case, we'd better
630
- * get the type info out of the datum itself. Note that for RECORD,
631
- * what we'll probably actually get is RECORD's typelem, ie, zero.
632
- */
633
- if (tupTy
7C37
pe == InvalidOid || tupType == RECORDOID )
634
- {
635
- tupType = HeapTupleHeaderGetTypeId (rec );
636
- tupTypmod = HeapTupleHeaderGetTypMod (rec );
637
- }
638
- else
639
- tupTypmod = -1 ;
619
+ /* Extract type info from the tuple itself */
620
+ tupType = HeapTupleHeaderGetTypeId (rec );
621
+ tupTypmod = HeapTupleHeaderGetTypMod (rec );
640
622
tupdesc = lookup_rowtype_tupdesc (tupType , tupTypmod );
641
623
ncolumns = tupdesc -> natts ;
642
624
0 commit comments