@ -450,14 +450,14 @@ DefineType(List *names, List *parameters)
{
{
/* backwards-compatibility hack */
/* backwards-compatibility hack */
ereport ( WARNING ,
ereport ( WARNING ,
( errmsg ( " changing return type of function %s from \" opaque \" to %s " ,
( errmsg ( " changing return type of function %s from \" %s \" to \" %s \" " ,
NameListToString ( inputName ) , typeName ) ) ) ;
NameListToString ( inputName ) , " opaque " , typeName ) ) ) ;
SetFunctionReturnType ( inputOid , typoid ) ;
SetFunctionReturnType ( inputOid , typoid ) ;
}
}
else
else
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " type input function %s must return type %s " ,
errmsg ( " type input function %s must return type \" %s \" " ,
NameListToString ( inputName ) , typeName ) ) ) ;
NameListToString ( inputName ) , typeName ) ) ) ;
}
}
resulttype = get_func_rettype ( outputOid ) ;
resulttype = get_func_rettype ( outputOid ) ;
@ -467,15 +467,15 @@ DefineType(List *names, List *parameters)
{
{
/* backwards-compatibility hack */
/* backwards-compatibility hack */
ereport ( WARNING ,
ereport ( WARNING ,
( errmsg ( " changing return type of function %s from \" opaque \" to \" cstring \" " ,
( errmsg ( " changing return type of function %s from \" %s \" to \" %s \" " ,
NameListToString ( outputName ) ) ) ) ;
NameListToString ( outputName ) , " opaque " , " cstring " ) ) ) ;
SetFunctionReturnType ( outputOid , CSTRINGOID ) ;
SetFunctionReturnType ( outputOid , CSTRINGOID ) ;
}
}
else
else
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " type output function %s must return type \" cstring \" " ,
errmsg ( " type output function %s must return type \" %s \" " ,
NameListToString ( outputName ) ) ) ) ;
NameListToString ( outputName ) , " cstring " ) ) ) ;
}
}
if ( receiveOid )
if ( receiveOid )
{
{
@ -483,7 +483,7 @@ DefineType(List *names, List *parameters)
if ( resulttype ! = typoid )
if ( resulttype ! = typoid )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " type receive function %s must return type %s " ,
errmsg ( " type receive function %s must return type \" %s \" " ,
NameListToString ( receiveName ) , typeName ) ) ) ;
NameListToString ( receiveName ) , typeName ) ) ) ;
}
}
if ( sendOid )
if ( sendOid )
@ -492,8 +492,8 @@ DefineType(List *names, List *parameters)
if ( resulttype ! = BYTEAOID )
if ( resulttype ! = BYTEAOID )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " type send function %s must return type \" bytea \" " ,
errmsg ( " type send function %s must return type \" %s \" " ,
NameListToString ( sendName ) ) ) ) ;
NameListToString ( sendName ) , " bytea " ) ) ) ;
}
}
/*
/*
@ -1834,8 +1834,8 @@ findTypeTypmodinFunction(List *procname)
if ( get_func_rettype ( procOid ) ! = INT4OID )
if ( get_func_rettype ( procOid ) ! = INT4OID )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " typmod_in function %s must return type \" integer \" " ,
errmsg ( " typmod_in function %s must return type \" %s \" " ,
NameListToString ( procname ) ) ) ) ;
NameListToString ( procname ) , " integer " ) ) ) ;
return procOid ;
return procOid ;
}
}
@ -1861,8 +1861,8 @@ findTypeTypmodoutFunction(List *procname)
if ( get_func_rettype ( procOid ) ! = CSTRINGOID )
if ( get_func_rettype ( procOid ) ! = CSTRINGOID )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " typmod_out function %s must return type \" cstring \" " ,
errmsg ( " typmod_out function %s must return type \" %s \" " ,
NameListToString ( procname ) ) ) ) ;
NameListToString ( procname ) , " cstring " ) ) ) ;
return procOid ;
return procOid ;
}
}
@ -1888,8 +1888,8 @@ findTypeAnalyzeFunction(List *procname, Oid typeOid)
if ( get_func_rettype ( procOid ) ! = BOOLOID )
if ( get_func_rettype ( procOid ) ! = BOOLOID )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " type analyze function %s must return type \" boolean \" " ,
errmsg ( " type analyze function %s must return type \" %s \" " ,
NameListToString ( procname ) ) ) ) ;
NameListToString ( procname ) , " boolean " ) ) ) ;
return procOid ;
return procOid ;
}
}
@ -2007,8 +2007,9 @@ findRangeSubtypeDiffFunction(List *procname, Oid subtype)
if ( get_func_rettype ( procOid ) ! = FLOAT8OID )
if ( get_func_rettype ( procOid ) ! = FLOAT8OID )
ereport ( ERROR ,
ereport ( ERROR ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
( errcode ( ERRCODE_INVALID_OBJECT_DEFINITION ) ,
errmsg ( " range subtype diff function %s must return type double precision " ,
errmsg ( " range subtype diff function %s must return type \" %s \" " ,
func_signature_string ( procname , 2 , NIL , argList ) ) ) ) ;
func_signature_string ( procname , 2 , NIL , argList ) ,
" double precision " ) ) ) ;
if ( func_volatile ( procOid ) ! = PROVOLATILE_IMMUTABLE )
if ( func_volatile ( procOid ) ! = PROVOLATILE_IMMUTABLE )
ereport ( ERROR ,
ereport ( ERROR ,