pgsql: Avoid misbehavior in foreign key checks when casting to a

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid misbehavior in foreign key checks when casting to a
Date: 2008-02-07 22:58:35
Message-ID: 20080207225835.2D19A754108@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Avoid misbehavior in foreign key checks when casting to a datatype for which
the parser supplies a default typmod that can result in data loss (ie,
truncation). Currently that appears to be only CHARACTER and BIT.
We can avoid the problem by specifying the type's internal name instead
of using SQL-spec syntax. Since the queries generated here are only used
internally, there's no need to worry about portability. This problem is
new in 8.3; before we just let the parser do whatever it wanted to resolve
the operator, but 8.3 is trying to be sure that the semantics of FK checks
are consistent. Per report from Harald Fuchs.

Modified Files:
--------------
pgsql/src/backend/utils/adt:
ri_triggers.c (r1.102 -> r1.103)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ri_triggers.c?r1=1.102&r2=1.103)

Browse pgsql-committers by date

  From Date Subject
Next Message User Carvalho 2008-02-08 03:06:45 pllua - pllua: Added support for PostgreSQL 8.3.
Previous Message Bruce Momjian 2008-02-07 22:28:54 pgsql: Add "automatically" to HOT release note description.