Re: Bug#347548: DOMAIN CHECK constraint bypassed

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Bug#347548: DOMAIN CHECK constraint bypassed
Дата
Msg-id 1138675817.8835.29.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Bug#347548: DOMAIN CHECK constraint bypassed  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
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:

http://archives.postgresql.org/pgsql-patches/2006-01/msg00107.php

(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...

-Neil

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug#347548: DOMAIN CHECK constraint bypassed
Следующее
От: Philipp Reisner
Дата:
Сообщение: Re: Endless loop in ExecNestLoop