Re: tsearch2api project

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: tsearch2api project
Дата
Msg-id 162867790710171234l11b6920p8845397923a98806@mail.gmail.com
обсуждение исходный текст
Ответ на Re: tsearch2api project  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: tsearch2api project  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2007/10/17, Tom Lane <tgl@sss.pgh.pa.us>:
> "Pavel Stehule" <pavel.stehule@gmail.com> writes:
> >> Surely this shouldn't be creating its own tsvector datatype?
>
> > I would to use only pg_catalog.tsvector. But dump contains CREATE TYPE
> > statement, and custom functions which prefere it, because path is:
> > public, pg_catalog :(. I didn't find any other solution with full
> > compatibility.
>
> I think we are really going to have to tell people to use the removets2
> script on their dumps in any case.  I can't imagine that it'll be a good
> idea to have a bogus tsvector type in the system -- it'll mess things
> up going forward.  I think probably the sort of solution you should be
> after is
>         1. load the compatibility module;
>         2. load dump that's been stripped of old tsearch2 stuff;
>         3. don't have to change anything else.
>

I agree.

@1 99% is done

I have question. Have I call directfunctioncallx interface for envelop fce?

If I don't modify any param from fce_info I can call directly wrapped function:

I used
#define ENVELOPE_FCE1(name,dest) \
Datum name (PG_FUNCTION_ARGS); \
PG_FUNCTION_INFO_V1(name); \
Datum \
name (PG_FUNCTION_ARGS) \
{ \       Datum arg0 = PG_GETARG_DATUM(0); \       return DirectFunctionCall1(dest, arg0); \
}

but I would
#define ENVELOPE_FCE(name,dest) \
Datum name (PG_FUNCTION_ARGS); \
PG_FUNCTION_INFO_V1(name); \
Datum \
name (PG_FUNCTION_ARGS) \
{ \       return (dest)(fceinfo); \
}

is it correct? or is better simple  modify pg_proc? There is maybe
10-15 fce where is necessary do something

Pavel


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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Proposal: PL/pgSQL EXECUTE INTO USING (for 8.4)
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: About to remove current contents of contrib/tsearch2