pgsql: Change plpgsql's cast cache to consider source typmod as signifi

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change plpgsql's cast cache to consider source typmod as signifi
Date: 2015-03-05 01:23:19
Message-ID: E1YTKVT-0003F5-MF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change plpgsql's cast cache to consider source typmod as significant.

I had thought that there was no need to maintain separate cache entries
for different source typmods, but further experimentation shows that there
is an advantage to doing so in some cases. In particular, if a domain has
a typmod (say, "CREATE DOMAIN d AS numeric(20,0)"), failing to notice the
source typmod leads to applying a length-coercion step even when the
source has the correct typmod.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7f3014dce56c7975113809f2ff5e92cf7c1563a3

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-03-05 03:00:41 pgsql: Avoid unused-variable warning in non-assert builds.
Previous Message Tom Lane 2015-03-05 00:11:04 pgsql: Need to special-case RECORD as well as UNKNOWN in plpgsql's cast