On Mon, 2006-01-30 at 20:45 -0500, Tom Lane wrote:
> You only fixed the bind-parameter case, though, no? The problem is
> still rampant in the PLs.
Right: the bug report was specific to the bind parameter case. Domain
constraints should also be checked before returning values of a domain
type from all of the procedural languages, and before casting a value to
a domain type in PL/PgSQL.
This can be done by adding constraint checks to each PL individually,
like this patch for PL/PgSQL's return value:
(The patch hasn't been applied because there is some additional
infrastructure needed to get good performance.)
We could do similar work for each PL. That actually wouldn't be too bad:
adding the necessary domain constraint information (plus sinval support)
to the typcache would allow most of the code to be shared. Or we could
refactor the code more cleanly, as Tom suggests -- it's not clear to me
quite how to do that without accepting a performance hit, though...
In response to
pgsql-bugs by date
|Next:||From: Philipp Reisner||Date: 2006-01-31 09:54:23|
|Subject: Re: Endless loop in ExecNestLoop|
|Previous:||From: Tom Lane||Date: 2006-01-31 01:45:28|
|Subject: Re: Bug#347548: DOMAIN CHECK constraint bypassed |