From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: review: CHECK FUNCTION statement |
Date: | 2011-11-30 18:21:54 |
Message-ID: | CAFj8pRCcQJJ95PceyVT77rPxnZb0DXK4_kYzqAfk5A=P64ZL3g@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2011-11-30 18:26:58 | Re: Why so few built-in range types? |
Previous Message | Tom Lane | 2011-11-30 18:20:35 | Re: Why so few built-in range types? |