<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.54 2005/01/04 00:39:53 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_type.sgml,v 1.55 2005/05/01 18:56:17 tgl Exp $
PostgreSQL documentation
-->
(or the type's own OID for a composite type),
and the third is the <literal>typmod</> of the destination column, if known
(-1 will be passed if not).
- The input function should return a value of the data type itself.
- The output function may be
- declared as taking one argument of the new data type, or as taking
- two arguments of which the second is type <type>oid</type>.
- The second argument is again the array element type OID for array types
- or the type OID for composite types.
- The output function should return type <type>cstring</type>.
+ The input function must return a value of the data type itself.
+ The output function must be
+ declared as taking one argument of the new data type.
+ The output function must return type <type>cstring</type>.
</para>
<para>
<replaceable class="parameter">send_function</replaceable> converts
from the internal representation to the external binary representation.
If this function is not supplied, the type cannot participate in binary
- output. The send function may be
- declared as taking one argument of the new data type, or as taking
- two arguments of which the second is type <type>oid</type>.
- The second argument is again the array element type OID for array types
- or the type OID for composite types.
+ output. The send function must be
+ declared as taking one argument of the new data type.
The send function must return type <type>bytea</type>.
</para>
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.89 2005/04/23 17:45:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.90 2005/05/01 18:56:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{ /* Per-attribute information */
Oid typoutput; /* Oid for the type's text output fn */
Oid typsend; /* Oid for the type's binary output fn */
- Oid typioparam; /* param to pass to the output fn */
bool typisvarlena; /* is it varlena (ie possibly toastable)? */
int16 format; /* format code for this column */
FmgrInfo finfo; /* Precomputed call info for output fn */
{
getTypeOutputInfo(typeinfo->attrs[i]->atttypid,
&thisState->typoutput,
- &thisState->typioparam,
&thisState->typisvarlena);
fmgr_info(thisState->typoutput, &thisState->finfo);
}
{
getTypeBinaryOutputInfo(typeinfo->attrs[i]->atttypid,
&thisState->typsend,
- &thisState->typioparam,
&thisState->typisvarlena);
fmgr_info(thisState->typsend, &thisState->finfo);
}
/* Text output */
char *outputstr;
- outputstr = DatumGetCString(FunctionCall3(&thisState->finfo,
- attr,
- ObjectIdGetDatum(thisState->typioparam),
- Int32GetDatum(typeinfo->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(FunctionCall1(&thisState->finfo,
+ attr));
pq_sendcountedtext(&buf, outputstr, strlen(outputstr), false);
pfree(outputstr);
}
/* Binary output */
bytea *outputbytes;
- outputbytes = DatumGetByteaP(FunctionCall2(&thisState->finfo,
- attr,
- ObjectIdGetDatum(thisState->typioparam)));
+ outputbytes = DatumGetByteaP(FunctionCall1(&thisState->finfo,
+ attr));
/* We assume the result will not have been toasted */
pq_sendint(&buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
pq_sendbytes(&buf, VARDATA(outputbytes),
else
attr = origattr;
- outputstr = DatumGetCString(FunctionCall3(&thisState->finfo,
- attr,
- ObjectIdGetDatum(thisState->typioparam),
- Int32GetDatum(typeinfo->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(FunctionCall1(&thisState->finfo,
+ attr));
pq_sendcountedtext(&buf, outputstr, strlen(outputstr), true);
pfree(outputstr);
attr;
char *value;
bool isnull;
- Oid typoutput,
- typioparam;
+ Oid typoutput;
bool typisvarlena;
for (i = 0; i < natts; ++i)
if (isnull)
continue;
getTypeOutputInfo(typeinfo->attrs[i]->atttypid,
- &typoutput, &typioparam, &typisvarlena);
+ &typoutput, &typisvarlena);
/*
* If we have a toasted datum, forcibly detoast it here to avoid
else
attr = origattr;
- value = DatumGetCString(OidFunctionCall3(typoutput,
- attr,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(typeinfo->attrs[i]->atttypmod)));
+ value = DatumGetCString(OidFunctionCall1(typoutput,
+ attr));
printatt((unsigned) i + 1, typeinfo->attrs[i], value);
else
attr = origattr;
- outputbytes = DatumGetByteaP(FunctionCall2(&thisState->finfo,
- attr,
- ObjectIdGetDatum(thisState->typioparam)));
+ outputbytes = DatumGetByteaP(FunctionCall1(&thisState->finfo,
+ attr));
/* We assume the result will not have been toasted */
pq_sendint(&buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
pq_sendbytes(&buf, VARDATA(outputbytes),
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.202 2005/04/14 20:03:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.203 2005/05/01 18:56:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
CStringGetDatum(value),
ObjectIdGetDatum(typioparam),
Int32GetDatum(-1));
- prt = DatumGetCString(OidFunctionCall3(typoutput,
- values[i],
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ prt = DatumGetCString(OidFunctionCall1(typoutput,
+ values[i]));
elog(DEBUG4, "inserted -> %s", prt);
pfree(prt);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.240 2005/04/14 20:03:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.241 2005/05/01 18:56:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Form_pg_attribute *attr;
FmgrInfo *out_functions;
bool *force_quote;
- Oid *typioparams;
- bool *isvarlena;
char *string;
ListCell *cur;
MemoryContext oldcontext;
* Get info about the columns we need to process.
*/
out_functions = (FmgrInfo *) palloc(num_phys_attrs * sizeof(FmgrInfo));
- typioparams = (Oid *) palloc(num_phys_attrs * sizeof(Oid));
- isvarlena = (bool *) palloc(num_phys_attrs * sizeof(bool));
force_quote = (bool *) palloc(num_phys_attrs * sizeof(bool));
foreach(cur, attnumlist)
{
int attnum = lfirst_int(cur);
Oid out_func_oid;
+ bool isvarlena;
if (binary)
getTypeBinaryOutputInfo(attr[attnum - 1]->atttypid,
- &out_func_oid, &typioparams[attnum - 1],
- &isvarlena[attnum - 1]);
+ &out_func_oid,
+ &isvarlena);
else
getTypeOutputInfo(attr[attnum - 1]->atttypid,
- &out_func_oid, &typioparams[attnum - 1],
- &isvarlena[attnum - 1]);
+ &out_func_oid,
+ &isvarlena);
fmgr_info(out_func_oid, &out_functions[attnum - 1]);
if (list_member_int(force_quote_atts, attnum))
{
if (!binary)
{
- string = DatumGetCString(FunctionCall3(&out_functions[attnum - 1],
- value,
- ObjectIdGetDatum(typioparams[attnum - 1]),
- Int32GetDatum(attr[attnum - 1]->atttypmod)));
+ string = DatumGetCString(FunctionCall1(&out_functions[attnum - 1],
+ value));
if (csv_mode)
{
CopyAttributeOutCSV(string, delim, quote, escape,
{
bytea *outputbytes;
- outputbytes = DatumGetByteaP(FunctionCall2(&out_functions[attnum - 1],
- value,
- ObjectIdGetDatum(typioparams[attnum - 1])));
+ outputbytes = DatumGetByteaP(FunctionCall1(&out_functions[attnum - 1],
+ value));
/* We assume the result will not have been toasted */
CopySendInt32(VARSIZE(outputbytes) - VARHDRSZ);
CopySendData(VARDATA(outputbytes),
MemoryContextDelete(mycontext);
pfree(out_functions);
- pfree(typioparams);
- pfree(isvarlena);
pfree(force_quote);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.70 2005/04/14 20:03:24 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.71 2005/05/01 18:56:18 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
static Oid
findTypeOutputFunction(List *procname, Oid typeOid)
{
- Oid argList[2];
+ Oid argList[1];
Oid procOid;
/*
- * Output functions can take a single argument of the type, or two
- * arguments (data value, element OID).
+ * Output functions can take a single argument of the type.
*
* For backwards compatibility we allow OPAQUE in place of the actual
* type name; if we see this, we issue a warning and fix up the
if (OidIsValid(procOid))
return procOid;
- argList[1] = OIDOID;
-
- procOid = LookupFuncName(procname, 2, argList, true);
- if (OidIsValid(procOid))
- return procOid;
-
/* No luck, try it with OPAQUE */
argList[0] = OPAQUEOID;
procOid = LookupFuncName(procname, 1, argList, true);
- if (!OidIsValid(procOid))
- {
- argList[1] = OIDOID;
-
- procOid = LookupFuncName(procname, 2, argList, true);
- }
-
if (OidIsValid(procOid))
{
/* Found, but must complain and fix the pg_proc entry */
static Oid
findTypeSendFunction(List *procname, Oid typeOid)
{
- Oid argList[2];
+ Oid argList[1];
Oid procOid;
/*
- * Send functions can take a single argument of the type, or two
- * arguments (data value, element OID).
+ * Send functions can take a single argument of the type.
*/
argList[0] = typeOid;
if (OidIsValid(procOid))
return procOid;
- argList[1] = OIDOID;
-
- procOid = LookupFuncName(procname, 2, argList, true);
- if (OidIsValid(procOid))
- return procOid;
-
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
errmsg("function %s does not exist",
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
result;
bool isnull;
Oid typoid,
- foutoid,
- typioparam;
- int32 typmod;
+ foutoid;
bool typisvarlena;
SPI_result = 0;
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
else
val = origval;
- result = OidFunctionCall3(foutoid,
- val,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(typmod));
+ result = OidFunctionCall1(foutoid,
+ val);
/* Clean up detoasted copy, if any */
if (val != origval)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.75 2005/04/19 22:35:15 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.76 2005/05/01 18:56:18 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
{
Const *c = (Const *) expr;
Oid typoutput;
- Oid typioparam;
bool typIsVarlena;
char *outputstr;
}
getTypeOutputInfo(c->consttype,
- &typoutput, &typioparam, &typIsVarlena);
+ &typoutput, &typIsVarlena);
- outputstr = DatumGetCString(OidFunctionCall3(typoutput,
- c->constvalue,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ outputstr = DatumGetCString(OidFunctionCall1(typoutput,
+ c->constvalue));
printf("%s", outputstr);
pfree(outputstr);
}
*
*
* 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.
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),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.119 2005/03/29 03:01:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.120 2005/05/01 18:56:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
bool typbyval;
char typalign;
char typdelim;
- Oid typioparam;
char *p,
*tmp,
*retval,
typbyval = my_extra->typbyval;
typalign = my_extra->typalign;
typdelim = my_extra->typdelim;
- typioparam = my_extra->typioparam;
ndim = ARR_NDIM(v);
dims = ARR_DIMS(v);
bool needquote;
itemvalue = fetch_att(p, typbyval, typlen);
- values[i] = DatumGetCString(FunctionCall3(&my_extra->proc,
- itemvalue,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ values[i] = DatumGetCString(FunctionCall1(&my_extra->proc,
+ itemvalue));
p = att_addlength(p, typlen, PointerGetDatum(p));
p = (char *) att_align(p, typalign);
int typlen;
bool typbyval;
char typalign;
- Oid typioparam;
char *p;
int nitems,
i;
typlen = my_extra->typlen;
typbyval = my_extra->typbyval;
typalign = my_extra->typalign;
- typioparam = my_extra->typioparam;
ndim = ARR_NDIM(v);
dim = ARR_DIMS(v);
itemvalue = fetch_att(p, typbyval, typlen);
- outputbytes = DatumGetByteaP(FunctionCall2(&my_extra->proc,
- itemvalue,
- ObjectIdGetDatum(typioparam)));
+ outputbytes = DatumGetByteaP(FunctionCall1(&my_extra->proc,
+ itemvalue));
/* We assume the result will not have been toasted */
pq_sendint(&buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
pq_sendbytes(&buf, VARDATA(outputbytes),
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/rowtypes.c,v 1.10 2005/04/30 20:04:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/rowtypes.c,v 1.11 2005/05/01 18:56:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
getTypeOutputInfo(column_type,
&column_info->typiofunc,
- &column_info->typioparam,
&typIsVarlena);
fmgr_info_cxt(column_info->typiofunc, &column_info->proc,
fcinfo->flinfo->fn_mcxt);
column_info->column_type = column_type;
}
- value = DatumGetCString(FunctionCall3(&column_info->proc,
- values[i],
- ObjectIdGetDatum(column_info->typioparam),
- Int32GetDatum(tupdesc->attrs[i]->atttypmod)));
+ value = DatumGetCString(FunctionCall1(&column_info->proc,
+ values[i]));
/* Detect whether we need double quotes for this value */
nq = (value[0] == '\0'); /* force quotes for empty string */
getTypeBinaryOutputInfo(column_type,
&column_info->typiofunc,
- &column_info->typioparam,
&typIsVarlena);
fmgr_info_cxt(column_info->typiofunc, &column_info->proc,
fcinfo->flinfo->fn_mcxt);
column_info->column_type = column_type;
}
- outputbytes = DatumGetByteaP(FunctionCall2(&column_info->proc,
- values[i],
- ObjectIdGetDatum(column_info->typioparam)));
+ outputbytes = DatumGetByteaP(FunctionCall1(&column_info->proc,
+ values[i]));
/* We assume the result will not have been toasted */
pq_sendint(&buf, VARSIZE(outputbytes) - VARHDRSZ, 4);
* back to source text
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.194 2005/04/30 08:08:50 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.195 2005/05/01 18:56:18 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
{
StringInfo buf = context->buf;
Oid typoutput;
- Oid typioparam;
bool typIsVarlena;
char *extval;
char *valptr;
}
getTypeOutputInfo(constval->consttype,
- &typoutput, &typioparam, &typIsVarlena);
+ &typoutput, &typIsVarlena);
- extval = DatumGetCString(OidFunctionCall3(typoutput,
- constval->constvalue,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ extval = DatumGetCString(OidFunctionCall1(typoutput,
+ constval->constvalue));
switch (constval->consttype)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.119 2005/02/23 22:46:17 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.120 2005/05/01 18:56:18 tgl Exp $
*
*-------------------------------------------------------------------------
*/
int typlen;
bool typbyval;
char typalign;
- Oid typioparam;
StringInfo result_str = makeStringInfo();
int i;
ArrayMetaState *my_extra;
typlen = my_extra->typlen;
typbyval = my_extra->typbyval;
typalign = my_extra->typalign;
- typioparam = my_extra->typioparam;
for (i = 0; i < nitems; i++)
{
itemvalue = fetch_att(p, typbyval, typlen);
- value = DatumGetCString(FunctionCall3(&my_extra->proc,
- itemvalue,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ value = DatumGetCString(FunctionCall1(&my_extra->proc,
+ itemvalue));
if (i > 0)
appendStringInfo(result_str, "%s%s", fldsep, value);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.124 2005/04/14 20:03:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.125 2005/05/01 18:56:19 tgl Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
* to typelem elsewhere in the code are wrong, if they are associated with
* I/O calls and not with actual subscripting operations! (But see
* bootstrap.c, which can't conveniently use this routine.)
+ *
+ * As of PostgreSQL 8.1, output functions receive only the value itself
+ * and not any auxiliary parameters, so the name of this routine is now
+ * a bit of a misnomer ... it should be getTypeInputParam.
*/
Oid
getTypeIOParam(HeapTuple typeTuple)
* Get info needed for printing values of a type
*/
void
-getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typIOParam,
- bool *typIsVarlena)
+getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
{
HeapTuple typeTuple;
Form_pg_type pt;
format_type_be(type))));
*typOutput = pt->typoutput;
- *typIOParam = getTypeIOParam(typeTuple);
*typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
ReleaseSysCache(typeTuple);
* Get info needed for binary output of values of a type
*/
void
-getTypeBinaryOutputInfo(Oid type, Oid *typSend, Oid *typIOParam,
- bool *typIsVarlena)
+getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
{
HeapTuple typeTuple;
Form_pg_type pt;
format_type_be(type))));
*typSend = pt->typsend;
- *typIOParam = getTypeIOParam(typeTuple);
*typIsVarlena = (!pt->typbyval) && (pt->typlen == -1);
ReleaseSysCache(typeTuple);
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.260 2005/04/21 19:18:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.261 2005/05/01 18:56:19 tgl Exp $
*
*--------------------------------------------------------------------
*/
Int32GetDatum(arg->typename->typmod));
intervalout =
- DatumGetCString(DirectFunctionCall3(interval_out,
- interval,
- ObjectIdGetDatum(InvalidOid),
- Int32GetDatum(-1)));
+ DatumGetCString(DirectFunctionCall1(interval_out,
+ interval));
appendStringInfo(&buf, "INTERVAL '%s'", intervalout);
}
else
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.98 2005/04/14 20:03:27 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.99 2005/05/01 18:56:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern Oid get_element_type(Oid typid);
extern Oid get_array_type(Oid typid);
extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam);
-extern void getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typIOParam,
- bool *typIsVarlena);
+extern void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena);
extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam);
-extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, Oid *typIOParam,
- bool *typIsVarlena);
+extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena);
extern Oid getBaseType(Oid typid);
extern int32 get_typavgwidth(Oid typid, int32 typmod);
extern int32 get_attavgwidth(Oid relid, AttrNumber attnum);
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.71 2005/04/01 19:34:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.72 2005/05/01 18:56:19 tgl Exp $
*
**********************************************************************/
Oid result_typioparam;
int nargs;
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
- Oid arg_typioparam[FUNC_MAX_ARGS];
bool arg_is_rowtype[FUNC_MAX_ARGS];
SV *reference;
} plperl_proc_desc;
{
char *tmp;
- tmp = DatumGetCString(FunctionCall3(&(desc->arg_out_func[i]),
- fcinfo->arg[i],
- ObjectIdGetDatum(desc->arg_typioparam[i]),
- Int32GetDatum(-1)));
+ tmp = DatumGetCString(FunctionCall1(&(desc->arg_out_func[i]),
+ fcinfo->arg[i]));
XPUSHs(sv_2mortal(newSVpv(tmp, 0)));
pfree(tmp);
}
prodesc->arg_is_rowtype[i] = false;
perm_fmgr_info(typeStruct->typoutput,
&(prodesc->arg_out_func[i]));
- prodesc->arg_typioparam[i] = getTypeIOParam(typeTup);
}
ReleaseSysCache(typeTup);
char *attname;
char *outputstr;
Oid typoutput;
- Oid typioparam;
bool typisvarlena;
int namelen;
/* XXX should have a way to cache these lookups */
getTypeOutputInfo(tupdesc->attrs[i]->atttypid,
- &typoutput, &typioparam, &typisvarlena);
+ &typoutput, &typisvarlena);
- outputstr = DatumGetCString(OidFunctionCall3(typoutput,
- attr,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(tupdesc->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(OidFunctionCall1(typoutput,
+ attr));
hv_store(hv, attname, namelen, newSVpv(outputstr, 0), 0);
}
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.135 2005/04/07 14:53:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.136 2005/05/01 18:56:19 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
convert_value_to_string(Datum value, Oid valtype)
{
Oid typoutput;
- Oid typioparam;
bool typIsVarlena;
- getTypeOutputInfo(valtype, &typoutput, &typioparam, &typIsVarlena);
+ getTypeOutputInfo(valtype, &typoutput, &typIsVarlena);
- return DatumGetCString(OidFunctionCall3(typoutput,
- value,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(-1)));
+ return DatumGetCString(OidFunctionCall1(typoutput, value));
}
/* ----------
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.95 2005/03/29 00:17:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.96 2005/05/01 18:56:19 tgl Exp $
*
**********************************************************************/
Oid result_typioparam;
int nargs;
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
- Oid arg_typioparam[FUNC_MAX_ARGS];
bool arg_is_rowtype[FUNC_MAX_ARGS];
} pltcl_proc_desc;
{
char *tmp;
- tmp = DatumGetCString(FunctionCall3(&prodesc->arg_out_func[i],
- fcinfo->arg[i],
- ObjectIdGetDatum(prodesc->arg_typioparam[i]),
- Int32GetDatum(-1)));
+ tmp = DatumGetCString(FunctionCall1(&prodesc->arg_out_func[i],
+ fcinfo->arg[i]));
UTF_BEGIN;
Tcl_DStringAppendElement(&tcl_cmd, UTF_E2U(tmp));
UTF_END;
prodesc->arg_is_rowtype[i] = false;
perm_fmgr_info(typeStruct->typoutput,
&(prodesc->arg_out_func[i]));
- prodesc->arg_typioparam[i] = getTypeIOParam(typeTup);
snprintf(buf, sizeof(buf), "%d", i + 1);
}
CONST84 char *attname;
HeapTuple typeTup;
Oid typoutput;
- Oid typioparam;
CONST84 char **arrptr;
CONST84 char **nameptr;
tupdesc->attrs[i]->atttypid);
typoutput = ((Form_pg_type) GETSTRUCT(typeTup))->typoutput;
- typioparam = getTypeIOParam(typeTup);
ReleaseSysCache(typeTup);
/************************************************************
************************************************************/
if (!isnull && OidIsValid(typoutput))
{
- outputstr = DatumGetCString(OidFunctionCall3(typoutput,
- attr,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(tupdesc->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(OidFunctionCall1(typoutput,
+ attr));
UTF_BEGIN;
Tcl_SetVar2(interp, *arrptr, *nameptr, UTF_E2U(outputstr), 0);
UTF_END;
char *attname;
HeapTuple typeTup;
Oid typoutput;
- Oid typioparam;
for (i = 0; i < tupdesc->natts; i++)
{
tupdesc->attrs[i]->atttypid);
typoutput = ((Form_pg_type) GETSTRUCT(typeTup))->typoutput;
- typioparam = getTypeIOParam(typeTup);
ReleaseSysCache(typeTup);
/************************************************************
************************************************************/
if (!isnull && OidIsValid(typoutput))
{
- outputstr = DatumGetCString(OidFunctionCall3(typoutput,
- attr,
- ObjectIdGetDatum(typioparam),
- Int32GetDatum(tupdesc->attrs[i]->atttypmod)));
+ outputstr = DatumGetCString(OidFunctionCall1(typoutput,
+ attr));
Tcl_DStringAppendElement(retval, attname);
UTF_BEGIN;
Tcl_DStringAppendElement(retval, UTF_E2U(outputstr));