diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-01 18:56:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-01 18:56:19 +0000 |
commit | 6c412f0605afeb809014553ff7ad28cf9ed5526b (patch) | |
tree | 5540a678c19dcfa1a7023e0f59a970fe2a9a79ee /src/backend/tcop/fastpath.c | |
parent | ae793ff63cb9167ea6d0f24ca018ffabad157ece (diff) | |
download | postgresql-6c412f0605afeb809014553ff7ad28cf9ed5526b.tar.gz postgresql-6c412f0605afeb809014553ff7ad28cf9ed5526b.zip |
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.
Diffstat (limited to 'src/backend/tcop/fastpath.c')
-rw-r--r-- | src/backend/tcop/fastpath.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index 42b73d49c0c..bd9b4903785 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.79 2005/03/29 03:01:31 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.80 2005/05/01 18:56:18 tgl Exp $ * * NOTES * This cruft is the server side of PQfn. @@ -149,31 +149,25 @@ SendFunctionResult(Datum retval, bool isnull, Oid rettype, int16 format) if (format == 0) { - Oid typoutput, - typioparam; + Oid typoutput; bool typisvarlena; char *outputstr; - getTypeOutputInfo(rettype, &typoutput, &typioparam, &typisvarlena); - outputstr = DatumGetCString(OidFunctionCall3(typoutput, - retval, - ObjectIdGetDatum(typioparam), - Int32GetDatum(-1))); + getTypeOutputInfo(rettype, &typoutput, &typisvarlena); + outputstr = DatumGetCString(OidFunctionCall1(typoutput, + retval)); pq_sendcountedtext(&buf, outputstr, strlen(outputstr), false); pfree(outputstr); } else if (format == 1) { - Oid typsend, - typioparam; + Oid typsend; bool typisvarlena; bytea *outputbytes; - getTypeBinaryOutputInfo(rettype, - &typsend, &typioparam, &typisvarlena); - outputbytes = DatumGetByteaP(OidFunctionCall2(typsend, - retval, - ObjectIdGetDatum(typioparam))); + getTypeBinaryOutputInfo(rettype, &typsend, &typisvarlena); + outputbytes = DatumGetByteaP(OidFunctionCall1(typsend, + retval)); /* We assume the result will not have been toasted */ pq_sendint(&buf, VARSIZE(outputbytes) - VARHDRSZ, 4); pq_sendbytes(&buf, VARDATA(outputbytes), |