diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 573d293f4ccfce01e4f4834eee58220104399c5e..c6658fca357ea98ef1beec4f61d6de0418240e84 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.236 2009/03/26 22:26:08 petere Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.237 2009/04/02 01:16:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4754,26 +4754,23 @@ exec_simple_cast_value(Datum value, Oid valtype, Oid reqtype, int32 reqtypmod, bool isnull) { - if (!isnull) + if (valtype != reqtype || reqtypmod != -1) { - if (valtype != reqtype || reqtypmod != -1) - { - Oid typinput; - Oid typioparam; - FmgrInfo finfo_input; + Oid typinput; + Oid typioparam; + FmgrInfo finfo_input; - getTypeInputInfo(reqtype, &typinput, &typioparam); + getTypeInputInfo(reqtype, &typinput, &typioparam); - fmgr_info(typinput, &finfo_input); + fmgr_info(typinput, &finfo_input); - value = exec_cast_value(value, - valtype, - reqtype, - &finfo_input, - typioparam, - reqtypmod, - isnull); - } + value = exec_cast_value(value, + valtype, + reqtype, + &finfo_input, + typioparam, + reqtypmod, + isnull); } return value;