From 6c412f0605afeb809014553ff7ad28cf9ed5526b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 1 May 2005 18:56:19 +0000 Subject: Change CREATE TYPE to require datatype output and send functions to have only one argument. (Per recent discussion, the option to accept multiple arguments is pretty useless for user-defined types, and would be a likely source of security holes if it was used.) Simplify call sites of output/send functions to not bother passing more than one argument. --- src/backend/executor/spi.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/backend/executor') diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index c72201c6e6a..0a9bede0e04 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.137 2005/03/29 02:53:53 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.138 2005/05/01 18:56:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -632,9 +632,7 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) result; bool isnull; Oid typoid, - foutoid, - typioparam; - int32 typmod; + foutoid; bool typisvarlena; SPI_result = 0; @@ -651,17 +649,11 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) return NULL; if (fnumber > 0) - { typoid = tupdesc->attrs[fnumber - 1]->atttypid; - typmod = tupdesc->attrs[fnumber - 1]->atttypmod; - } else - { typoid = (SystemAttributeDefinition(fnumber, true))->atttypid; - typmod = -1; - } - getTypeOutputInfo(typoid, &foutoid, &typioparam, &typisvarlena); + getTypeOutputInfo(typoid, &foutoid, &typisvarlena); /* * If we have a toasted datum, forcibly detoast it here to avoid @@ -672,10 +664,8 @@ SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber) else val = origval; - result = OidFunctionCall3(foutoid, - val, - ObjectIdGetDatum(typioparam), - Int32GetDatum(typmod)); + result = OidFunctionCall1(foutoid, + val); /* Clean up detoasted copy, if any */ if (val != origval) -- cgit v1.2.3