gin--a rule for function parameter

Поиск
Список
Период
Сортировка
От Fly.Li
Тема gin--a rule for function parameter
Дата
Msg-id h2fbov$al5$1@news.hub.org
обсуждение исходный текст
Ответы Re: gin--a rule for function parameter  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
version: PG8.2.2

MY Question:
Why must "take the same number of parameters" ?

" We can check that all the referenced instances of the same support routine 
number take the same number of parameters" ?

1 there is no results by running regress test as follow:
plsql/src/test/regress/sql/opr_sanity.sql
......
-- Unfortunately, we can't check the amproc link very well because the
-- signature of the function may be different for different support routines
-- or different base data types.
-- We can check that all the referenced instances of the same support
-- routine number take the same number of parameters, but that's about it
-- for a general check...
SELECT p1.amopclaid, p1.amprocnum,p2.oid, p2.proname,p3.opcname,p4.amopclaid, p4.amprocnum,p5.oid,
p5.proname,p6.opcname
FROM sys_amproc AS p1, sys_proc AS p2, sys_opclass AS p3,    sys_amproc AS p4, sys_proc AS p5, sys_opclass AS p6
WHERE p1.amopclaid = p3.oid AND p4.amopclaid = p6.oid AND   p3.opcamid = p6.opcamid AND p1.amprocnum = p4.amprocnum AND
 p1.amproc = p2.oid AND p4.amproc = p5.oid AND   (p2.proretset OR p5.proretset OR p2.pronargs != p5.pronargs);
 

But,
contrib\tsearch2\tsearch.sql.in:
...
CREATE OPERATOR CLASS gin_tsvector_ops
DEFAULT FOR TYPE tsvector USING gin
AS       OPERATOR        1       @@ (tsvector, tsquery),       OPERATOR        2       @@@ (tsvector, tsquery) RECHECK,
     FUNCTION        1       bttextcmp(text, text),       FUNCTION        2
gin_extract_tsvector(tsvector,internal),      FUNCTION        3 
 
gin_extract_tsquery(tsquery,internal,internal),       FUNCTION        4 
gin_ts_consistent(internal,internal,tsquery),       STORAGE         text;

When I use tsearch2, I found that gin_extract_tsquery() has 3 parameters, it 
break the rule "take the same number of parameters".
So, who can tell me whether the rule is right?


Grateful,
Fly.Li

for example, "ginarrayextract" function has two parameters
----------------------amopclaid | amprocnum | oid  |       proname       |     opcname      | 
amopclaid | amprocnum | oid  |       proname       |     opcname

-----------+-----------+------+---------------------+------------------+-----------+-----------+------+---------------------+------------------
   2771 |         3 | 2743 | ginarrayextract     | _oidvector_ops
 




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

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: pre-proposal: permissions made easier
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Extensions User Design