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

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: ?ukasz Dejneka <l(dot)dejneka(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Internal PG functions, how to pass proper parameters?
Date: 2010-04-07 20:53:30
Message-ID: 20100407205330.GA30100@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)svana(dot)org> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-04-07 20:54:23 Re: Solid State Drives with PG
Previous Message Merlin Moncure 2010-04-07 20:43:51 Re: Solid State Drives with PG