@ -802,10 +802,12 @@ exprCollation(const Node *expr)
coll = ( ( const NullIfExpr * ) expr ) - > opcollid ;
break ;
case T_ScalarArrayOpExpr :
coll = InvalidOid ; /* result is always boolean */
/* ScalarArrayOpExpr's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_BoolExpr :
coll = InvalidOid ; /* result is always boolean */
/* BoolExpr's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_SubLink :
{
@ -827,8 +829,8 @@ exprCollation(const Node *expr)
}
else
{
/* otherwise, result is RECORD or BOOLEAN */
coll = InvalidOid ;
/* otherwise, SubLink's result is RECORD or BOOLEAN */
coll = InvalidOid ; /* ... so it has no collation */
}
}
break ;
@ -845,8 +847,8 @@ exprCollation(const Node *expr)
}
else
{
/* otherwise, result is RECORD or BOOLEAN */
coll = InvalidOid ;
/* otherwise, SubPlan's result is RECORD or BOOLEAN */
coll = InvalidOid ; /* ... so it has no collation */
}
}
break ;
@ -862,7 +864,8 @@ exprCollation(const Node *expr)
coll = ( ( const FieldSelect * ) expr ) - > resultcollid ;
break ;
case T_FieldStore :
coll = InvalidOid ; /* result is always composite */
/* FieldStore's result is composite ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_RelabelType :
coll = ( ( const RelabelType * ) expr ) - > resultcollid ;
@ -874,7 +877,8 @@ exprCollation(const Node *expr)
coll = ( ( const ArrayCoerceExpr * ) expr ) - > resultcollid ;
break ;
case T_ConvertRowtypeExpr :
coll = InvalidOid ; /* result is always composite */
/* ConvertRowtypeExpr's result is composite ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_CollateExpr :
coll = ( ( const CollateExpr * ) expr ) - > collOid ;
@ -889,10 +893,12 @@ exprCollation(const Node *expr)
coll = ( ( const ArrayExpr * ) expr ) - > array_collid ;
break ;
case T_RowExpr :
coll = InvalidOid ; /* result is always composite */
/* RowExpr's result is composite ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_RowCompareExpr :
coll = InvalidOid ; /* result is always boolean */
/* RowCompareExpr's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_CoalesceExpr :
coll = ( ( const CoalesceExpr * ) expr ) - > coalescecollid ;
@ -920,10 +926,12 @@ exprCollation(const Node *expr)
coll = InvalidOid ;
break ;
case T_NullTest :
coll = InvalidOid ; /* result is always boolean */
/* NullTest's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_BooleanTest :
coll = InvalidOid ; /* result is always boolean */
/* BooleanTest's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_CoerceToDomain :
coll = ( ( const CoerceToDomain * ) expr ) - > resultcollid ;
@ -935,10 +943,12 @@ exprCollation(const Node *expr)
coll = ( ( const SetToDefault * ) expr ) - > collation ;
break ;
case T_CurrentOfExpr :
coll = InvalidOid ; /* result is always boolean */
/* CurrentOfExpr's result is boolean ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_NextValueExpr :
coll = InvalidOid ; /* result is always an integer type */
/* NextValueExpr's result is an integer type ... */
coll = InvalidOid ; /* ... so it has no collation */
break ;
case T_InferenceElem :
coll = exprCollation ( ( Node * ) ( ( const InferenceElem * ) expr ) - > expr ) ;
@ -1050,10 +1060,12 @@ exprSetCollation(Node *expr, Oid collation)
( ( NullIfExpr * ) expr ) - > opcollid = collation ;
break ;
case T_ScalarArrayOpExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* ScalarArrayOpExpr's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_BoolExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* BoolExpr's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_SubLink :
# ifdef USE_ASSERT_CHECKING
@ -1085,7 +1097,8 @@ exprSetCollation(Node *expr, Oid collation)
( ( FieldSelect * ) expr ) - > resultcollid = collation ;
break ;
case T_FieldStore :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always composite */
/* FieldStore's result is composite ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_RelabelType :
( ( RelabelType * ) expr ) - > resultcollid = collation ;
@ -1097,7 +1110,8 @@ exprSetCollation(Node *expr, Oid collation)
( ( ArrayCoerceExpr * ) expr ) - > resultcollid = collation ;
break ;
case T_ConvertRowtypeExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always composite */
/* ConvertRowtypeExpr's result is composite ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_CaseExpr :
( ( CaseExpr * ) expr ) - > casecollid = collation ;
@ -1106,10 +1120,12 @@ exprSetCollation(Node *expr, Oid collation)
( ( ArrayExpr * ) expr ) - > array_collid = collation ;
break ;
case T_RowExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always composite */
/* RowExpr's result is composite ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_RowCompareExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* RowCompareExpr's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_CoalesceExpr :
( ( CoalesceExpr * ) expr ) - > coalescecollid = collation ;
@ -1128,10 +1144,12 @@ exprSetCollation(Node *expr, Oid collation)
( collation = = InvalidOid ) ) ;
break ;
case T_NullTest :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* NullTest's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_BooleanTest :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* BooleanTest's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_CoerceToDomain :
( ( CoerceToDomain * ) expr ) - > resultcollid = collation ;
@ -1143,11 +1161,12 @@ exprSetCollation(Node *expr, Oid collation)
( ( SetToDefault * ) expr ) - > collation = collation ;
break ;
case T_CurrentOfExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always boolean */
/* CurrentOfExpr's result is boolean ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
case T_NextValueExpr :
Assert ( ! OidIsValid ( collation ) ) ; /* result is always an integer
* type */
/* NextValueExpr's result is an integer type ... */
Assert ( ! OidIsValid ( collation ) ) ; /* ... so never set a collation */
break ;
default :
elog ( ERROR , " unrecognized node type: %d " , ( int ) nodeTag ( expr ) ) ;