pgsql: plpgsql's exec_simple_cast_value() mistakenly supposed that it - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: plpgsql's exec_simple_cast_value() mistakenly supposed that it
Date
Msg-id 20090402011617.C5168754ADE@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
plpgsql's exec_simple_cast_value() mistakenly supposed that it could bypass
casting effort whenever the input value was NULL.  However this prevents
application of not-null domain constraints in the cases that use this
function, as illustrated in bug #4741.  Since this function isn't meant
for use in performance-critical paths anyway, this certainly seems like
another case of "premature optimization is the root of all evil".

Back-patch as far as 8.2; older versions made no effort to enforce
domain constraints here anyway.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/pl/plpgsql/src:
        pl_exec.c (r1.202.2.4 -> r1.202.2.5)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c?r1=1.202.2.4&r2=1.202.2.5)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: plpgsql's exec_simple_cast_value() mistakenly supposed that it
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: plpgsql's exec_simple_cast_value() mistakenly supposed that it