Skip site navigation (1) Skip section navigation (2)

Re: gin--a rule for function parameter

From: "Fly(dot)Li" <fly2nn(at)126(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: gin--a rule for function parameter
Date: 2009-07-02 01:49:48
Message-ID: h2h3o3$28o3$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-hackers
1 ginarrayextract() has 2 parameters
2 gin_extract_tsquery() has 3 parameters
3 run sql(from plsql/src/test/regress/sql/opr_sanity.sql), it expect no 
results:
-------------
SELECT p1.amopclaid, p1.amprocnum,
 p2.oid, p2.proname,
 p3.opcname,
 p4.amopclaid, p4.amprocnum,
 p5.oid, p5.proname,
 p6.opcname
FROM pg_amproc AS p1, pg_proc AS p2, pg_opclass AS p3,
     pg_amproc AS p4, pg_proc AS p5, pg_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);
--------------
We can get results as follow:
 amopclaid | amprocnum | oid  |       proname       |     opcname      | 
amopclaid | amprocnum | oid  |       proname       |     opcname
-----------+-----------+------+---------------------+------------------+-----------+-----------+------+---------------------+------------------
      2771 |         3 | 2743 | ginarrayextract     | _oidvector_ops   | 
3659 |         3 | 3657 | gin_extract_tsquery | tsvector_ops
      2759 |         3 | 2743 | ginarrayextract     | _cidr_ops        | 
3659 |         3 | 3657 | gin_extract_tsquery | tsvector_ops
      2768 |         3 | 2743 | ginarrayextract     | _name_ops        | 
3659 |         3 | 3657 | gin_extract_tsquery | tsvector_ops
......
4 But, reading "plsql/src/test/regress/sql/opr_sanity.sql", there is a 
sentence said:
" We can check that all the referenced instances of the same support routine 
number take the same number of parameters" ?

5 So, ginarrayextract() and gin_extract_tsquery() should take the same 
number of parameters?
Or, " We can check that all the referenced instances of the same support 
routine number take the same number of parameters" is not a right?

6 Actually, pgsql allow all the referenced instances of the same support 
routine number do not take the same number of parameters.

Thanks.
Fly.Li



"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> :<10550(dot)1246457758(at)sss(dot)pgh(dot)pa(dot)us>...
> "Fly.Li" <fly2nn(at)126(dot)com> writes:
> > version: PG8.2.2
> > MY Question:
> > Why must "take the same number of parameters" ?
>
> Because the GIN code will call it with a particular number of arguments.
>
> > When I use tsearch2, I found that gin_extract_tsquery() has 3 
> > parameters, it
> > break the rule "take the same number of parameters".
>
> 3 is the correct number of parameters for an extractQuery function
> (before 8.4 anyway), so I'm not clear what you are complaining about.
>
>    regards, tom lane
>
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
> 


In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2009-07-02 02:14:02
Subject: Re: 8.5 development schedule
Previous:From: Bruce MomjianDate: 2009-07-02 01:32:19
Subject: Re: Query progress indication - an implementation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group