Обсуждение: track functions call

Поиск
Список
Период
Сортировка

track functions call

От
Mark
Дата:
Is there in PostgreSQL posibility to track which function in C file is called
by postgres functions. For example I would like to see which functions are
calling in ts_rank.
Thanks for reply
Mark

--
View this message in context: http://postgresql.1045698.n5.nabble.com/track-functions-call-tp4384220p4384220.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: track functions call

От
Cédric Villemain
Дата:
2011/5/10 Mark <Marek.Balgar@seznam.cz>:
> Is there in PostgreSQL posibility to track which function in C file is called
> by postgres functions. For example I would like to see which functions are
> calling in ts_rank.

select proname,prosrc from pg_proc where proname = 'ts_rank';
 proname |    prosrc
---------+--------------
 ts_rank | ts_rank_wttf
 ts_rank | ts_rank_wtt
 ts_rank | ts_rank_ttf
 ts_rank | ts_rank_tt

The same table contain list of arg type and return type, etc...


> Thanks for reply
> Mark
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/track-functions-call-tp4384220p4384220.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

Re: track functions call

От
Mark
Дата:
Thanks for quick reply,
but I want to know, which of these method is called in concrete situation. I
suppose, that ts_rank call only one of these functions(ts_rank_wttf ,
ts_rank_wtt , ts_rank_ttf ,ts_rank_tt ). Is it possible?
Thanks for reply
Mark

--
View this message in context: http://postgresql.1045698.n5.nabble.com/track-functions-call-tp4384220p4385392.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: track functions call

От
Cédric Villemain
Дата:
2011/5/10 Mark <Marek.Balgar@seznam.cz>:
> Thanks for quick reply,
> but I want to know, which of these method is called in concrete situation. I
> suppose, that ts_rank call only one of these functions(ts_rank_wttf ,
> ts_rank_wtt , ts_rank_ttf ,ts_rank_tt ). Is it possible?

Yes, same table:
select proname,prosrc,prorettype,proargtypes from pg_proc where
proname = 'ts_rank';
          proname |    prosrc    | prorettype |    proargtypes
---------+--------------+------------+-------------------
 ts_rank | ts_rank_wttf |        700 | 1021 3614 3615 23
 ts_rank | ts_rank_wtt  |        700 | 1021 3614 3615
 ts_rank | ts_rank_ttf  |        700 | 3614 3615 23
 ts_rank | ts_rank_tt   |        700 | 3614 3615

 select oid,typname from pg_type where oid in ('1021','3614','3615','23','700');
 oid  | typname
------+----------
   23 | int4
  700 | float4
 1021 | _float4
 3614 | tsvector
 3615 | tsquery

so you can find what go with what for the ts_rank function :

ts_rank([ weights float4[], ] vector tsvector,
        query tsquery [, normalization integer ]) returns float4


> Thanks for reply
> Mark
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/track-functions-call-tp4384220p4385392.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support