Notice about costly ri checks

Started by Fabien COELHOover 22 years ago3 messagespatches
Jump to latest
#1Fabien COELHO
coelho@cri.ensmp.fr

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

Attachments:

costly_ri_notice.patchtext/plain; charset=US-ASCII; name=costly_ri_notice.patchDownload+25-21
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Fabien COELHO (#1)
Re: Notice about costly ri checks

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

#3Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Tom Lane (#2)
Re: Notice about costly ri checks

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