Обсуждение: Notice about costly ri checks

Поиск
Список
Период
Сортировка

Notice about costly ri checks

От
Fabien COELHO
Дата:
Dear patchers,

This patch adds a "notice" at constraint creation time if the referential
integrity check is to be "costly", that is the comparison operator
involves some coercion. The patch also accepts the validation of the
regression tests with the added notice.

The patch was generated with the "difforig" script against the current cvs
head.

Thanks in advance for considering it, and for any comment or cheering,

--
Fabien Coelho - coelho@cri.ensmp.fr

Вложения

Re: Notice about costly ri checks

От
Tom Lane
Дата:
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> This patch adds a "notice" at constraint creation time if the referential
> integrity check is to be "costly", that is the comparison operator
> involves some coercion.

This is not the correct test at all.  The correct test would involve
looking in pg_amop to see if the selected operator is a member of the
opclass for the referenced column's index.  (IIRC there are helper
functions in lsyscache.c that will make this easier.)

            regards, tom lane

Re: Notice about costly ri checks

От
Fabien COELHO
Дата:
> > This patch adds a "notice" at constraint creation time if the referential
> > integrity check is to be "costly", that is the comparison operator
> > involves some coercion.
>
> This is not the correct test at all.

You mean my morning 5mn programming will not be enough? ;-)

> The correct test would involve
> looking in pg_amop to see if the selected operator is a member of the
> opclass for the referenced column's index.  (IIRC there are helper
> functions in lsyscache.c that will make this easier.)

Ok, I'll have a look.

--
Fabien Coelho - coelho@cri.ensmp.fr