Re: review: CHECK FUNCTION statement - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: review: CHECK FUNCTION statement
Date
Msg-id CAFj8pRCcQJJ95PceyVT77rPxnZb0DXK4_kYzqAfk5A=P64ZL3g@mail.gmail.com
Whole thread Raw
In response to Re: review: CHECK FUNCTION statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: review: CHECK FUNCTION statement
List pgsql-hackers
Hello

I rechecked a possibility to use a validator function together with
checker function.

The main issue is a different interface of both functions. Validator
needs just function oid and uses global variable
check_function_bodies. Checker function needs function oid and
relation oid (possible some other params). When we mix these two
functions together we need a

validator(oid) or validator(oid, oid, variadic "any")

one parameter function is old validator, three parameters function is checker.

Question:

What is a correct signature for this function? We cannot use a
overloading, because we can have only one validator function per
language. We can change a validator to support both forms, and we have
to be carefully and correct if we will work with our validators(3 and
more params) or foreign validators (1 param). We should to support
both (compatibility reasons). We are not careful about validators now
- there are some places, where one parameter is hardly expected - this
should be changed. So using validator for checking doesn't mean
smaller patch, but is true, so these functions has similar semantic -
validator is usually "low level" checker.

What is your opinion?

Regards

Pavel


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Word-smithing doc changes
Next
From: Robert Haas
Date:
Subject: Re: Why so few built-in range types?