Search Postgresql Archives

Re: Internal PG functions, how to pass proper parameters?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 07, 2010 at 10:30:35AM +0200, ?ukasz Dejneka wrote:
> Hi all
> 
> I need a bit assistance. In  ../src/backend/utils/adt/tsginidx.c there
> is a function called gin_extract_tsquery.

<snip>

> The above function call is incompleate (only 2 params instead of 5)
> but it's not relevant at this point. The issue is that no matter what
> I pass (Datum, pointer to Datum, pointer to char, pointer to int32, PG
> macros to variables and pointers, etc...) as a 2nd parameter I get an
> error when I call my wrapper function from Postgres. It goes well
> right until the line before "step: 04" notice in gin_extract_tsquery.
> Namely the "*nentries = 0;" line.

This may be silly, but did you declare your function to be a V1
function?

> Also a related question: Is it possible to launch a function like
> gin_extract_query directly from Postgres? I'ts decralation is:
> 
> CREATE OR REPLACE FUNCTION gin_extract_tsquery(tsquery, internal,
> smallint, internal, internal)
>   RETURNS internal AS ....
> 
> I've tried to find something about "internal" parameters in functions
> in manual but failed. If it's possible, what would be a working
> example?

"internal" usually means a "pointer to something you can't make from
SQL". So you might be able to declare the function, but in no way could
you actually call it successfully.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first. 
>                                       - Charles de Gaulle

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux