@ -33,6 +33,18 @@ static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName,
/*
* LookupTypeName
* Wrapper for typical case .
*/
Type
LookupTypeName ( ParseState * pstate , const TypeName * typeName ,
int32 * typmod_p , bool missing_ok )
{
return LookupTypeNameExtended ( pstate ,
typeName , typmod_p , true , missing_ok ) ;
}
/*
* LookupTypeNameExtended
* Given a TypeName object , lookup the pg_type syscache entry of the type .
* Returns NULL if no such type can be found . If the type is found ,
* the typmod value represented in the TypeName struct is computed and
@ -51,11 +63,17 @@ static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName,
* found but is a shell , and there is typmod decoration , an error will be
* thrown - - - this is intentional .
*
* If temp_ok is false , ignore types in the temporary namespace . Pass false
* when the caller will decide , using goodness of fit criteria , whether the
* typeName is actually a type or something else . If typeName always denotes
* a type ( or denotes nothing ) , pass true .
*
* pstate is only used for error location info , and may be NULL .
*/
Type
LookupTypeName ( ParseState * pstate , const TypeName * typeName ,
int32 * typmod_p , bool missing_ok )
LookupTypeNameExtended ( ParseState * pstate ,
const TypeName * typeName , int32 * typmod_p ,
bool temp_ok , bool missing_ok )
{
Oid typoid ;
HeapTuple tup ;
@ -172,7 +190,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typeName,
else
{
/* Unqualified type name, so search the search path */
typoid = TypenameGetTypid ( typname ) ;
typoid = TypenameGetTypidExtended ( typname , temp_ok ) ;
}
/* If an array reference, return the array type instead */