parse_expr.c:typecast_expression:return immediate on NULL input
in parse_expr.c:typecast_expression: return immediate on NULL input,
i.e. do not lookup target type Oid as it is not required.
-Hannes
Attachments:
parse_expr.c-200711231.difftext/plain; name=parse_expr.c-200711231.diffDownload+2-2
Hannes Eder <Hannes@HannesEder.net> writes:
in parse_expr.c:typecast_expression: return immediate on NULL input,
i.e. do not lookup target type Oid as it is not required.
I think the existing ordering is intentional, to detect and error out
if the given typename is bogus.
It's fairly likely that the test for InvalidOid is dead code anyway,
but it's cheap enough that I'm not in a hurry to take it out.
regards, tom lane
Tom Lane <tgl@sss.pgh.pa.us> writes:
Hannes Eder <Hannes@HannesEder.net> writes:
in parse_expr.c:typecast_expression: return immediate on NULL
input, i.e. do not lookup target type Oid as it is not required.
I think the existing ordering is intentional, to detect and error
out if the given typename is bogus.
Ups, yes, you are right. typecast_expression calls typenameTypeId and
this calls typenameType, which will ereport an error if the typename
cannot be found.
-Hannes