* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.154.2.9 2009/12/29 17:41:35 heikki Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.154.2.10 2010/02/12 19:38:08 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
*/
PLpgSQL_row *row = (PLpgSQL_row *) target;
- /* Source must be of RECORD or composite type */
- if (!(valtype == RECORDOID ||
- get_typtype(valtype) == 'c'))
- ereport(ERROR,
- (errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("cannot assign non-composite value to a row variable")));
if (*isNull)
{
/* If source is null, just assign nulls to the row */
TupleDesc tupdesc;
HeapTupleData tmptup;
- /* Else source is a tuple Datum, safe to do this: */
+ /* Source must be of RECORD or composite type */
+ if (!(valtype == RECORDOID ||
+ get_typtype(valtype) == 'c'))
+ ereport(ERROR,
+ (errcode(ERRCODE_DATATYPE_MISMATCH),
+ errmsg("cannot assign non-composite value to a row variable")));
+ /* So source is a tuple Datum, safe to do this: */
td = DatumGetHeapTupleHeader(value);
/* Extract rowtype info and find a tupdesc */
tupType = HeapTupleHeaderGetTypeId(td);
*/
PLpgSQL_rec *rec = (PLpgSQL_rec *) target;
- /* Source must be of RECORD or composite type */
- if (!(valtype == RECORDOID ||
- get_typtype(valtype) == 'c'))
- ereport(ERROR,
- (errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg("cannot assign non-composite value to a record variable")));
if (*isNull)
{
/* If source is null, just assign nulls to the record */
TupleDesc tupdesc;
HeapTupleData tmptup;
- /* Else source is a tuple Datum, safe to do this: */
+ /* Source must be of RECORD or composite type */
+ if (!(valtype == RECORDOID ||
+ get_typtype(valtype) == 'c'))
+ ereport(ERROR,
+ (errcode(ERRCODE_DATATYPE_MISMATCH),
+ errmsg("cannot assign non-composite value to a record variable")));
+ /* So source is a tuple Datum, safe to do this: */
td = DatumGetHeapTupleHeader(value);
/* Extract rowtype info and find a tupdesc */
tupType = HeapTupleHeaderGetTypeId(td);