Re: making tsearch2 dictionaries - Mailing list pgsql-general

From Oleg Bartunov
Subject Re: making tsearch2 dictionaries
Date
Msg-id Pine.GSO.4.58.0402162130410.3452@ra.sai.msu.su
Whole thread Raw
In response to Re: making tsearch2 dictionaries  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: making tsearch2 dictionaries
List pgsql-general
btw, Ben, if you get you dictionary working, could you describe process
of developing so  other people will appreciate your work. This part of
tsearch2 documentation is very weak.

    Oleg

On Mon, 16 Feb 2004, Teodor Sigaev wrote:

>
>
> Ben wrote:
> > Thanks for the replies. Just to clarify what I was doing, quaicode
> > looked something like:
> >
> > phrase = palloc(8);
> > phrase = "foo\0bar\0";
> > res = palloc(3);
> > res[0] = phrase[0];
> > res[1] = phrase[5];
> > res[2] = 0;
> >
> > That crashed. Once I changed it to:
> >
> > res = palloc(3);
> > res[0] = palloc(4);
> > res[0] = "foo\0";
> > res[1] = palloc(4);
> > res[2] = "bar\0";
> > res[3] = 0;
> >
> > it worked.
> >
> :)
> I hope you mean:
> res = palloc(3);
> res[0] = palloc(4);
> memcpy(res[0] ,"foo", 4);
> res[1] = palloc(4);
> memcpy(res[1] ,"bar", 4);
> res[2] = 0;
>
> Look at indexes of res.
>
>

    Regards,
        Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

pgsql-general by date:

Previous
From: "Nick Barr"
Date:
Subject: Select for update, locks and transaction levels
Next
From: Tom Lane
Date:
Subject: Re: How do I call multiple functions in one trigger?