Thread: tsearch2 question

tsearch2 question

From
Wei Weng
Date:
In my tsearch2.sql there are statements like :


--dict interface
CREATE FUNCTION lexize(oid, text) returns _textas '$libdir/tsearch2'language 'C'with (isstrict);


I don't think $libdir is the real value that we want. Do I need to set
some special parameters with ./configure (in the root level of the source
tree) to replace $libdir with the real library path?

Thanks

Wei



Re: tsearch2 question

From
Tom Lane
Date:
Wei Weng <wweng@kencast.com> writes:
> In my tsearch2.sql there are statements like :
> --dict interface
> CREATE FUNCTION lexize(oid, text) 
>     returns _text
>     as '$libdir/tsearch2'
>     language 'C'
>     with (isstrict);

> I don't think $libdir is the real value that we want.

Yes it is.
        regards, tom lane


Re: tsearch2 question

From
Wei Weng
Date:
But then when I do a psql < tsearch2.sql, it complains:

bash-2.05a$ psql testdb < tsearch2.sql 
SET
BEGIN
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
'pg_ts_dict_pkey' for table 'pg_ts_dict'
CREATE TABLE
ERROR:  stat failed on file '$libdir/tsearch2': No such file or directory
ERROR:  current transaction is aborted, queries ignored until end of 
transaction block
ERROR:  current transaction is aborted, queries ignored until end of 
transaction block
...
(and the ERROR message repeats many times)

Where did I do wrong??

Thanks

Wei


On Thu, 25 Sep 2003, Tom Lane wrote:

> Wei Weng <wweng@kencast.com> writes:
> > In my tsearch2.sql there are statements like :
> > --dict interface
> > CREATE FUNCTION lexize(oid, text) 
> >     returns _text
> >     as '$libdir/tsearch2'
> >     language 'C'
> >     with (isstrict);
> 
> > I don't think $libdir is the real value that we want.
> 
> Yes it is.
> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 


Re: tsearch2 question

From
Tom Lane
Date:
Wei Weng <wweng@kencast.com> writes:
> But then when I do a psql < tsearch2.sql, it complains:
> bash-2.05a$ psql testdb < tsearch2.sql 
> ERROR:  stat failed on file '$libdir/tsearch2': No such file or directory
> Where did I do wrong??

Did you do "make install" after building tsearch2?

If you did, maybe it installed tsearch2.so in the wrong place?
("pg_config --pkglibdir" will tell you what the backend thinks
"$libdir" means.)
        regards, tom lane


Re: tsearch2 question

From
Wei Weng
Date:
When I run psql < tsearch2.sql, is psql going to substitute $libdir 
internally with what $libdir really is (in my case, it would be 
/usr/lib/pgsql)? 

Thanks

Wei


On Fri, 26 Sep 2003, Tom Lane wrote:

> Wei Weng <wweng@kencast.com> writes:
> > But then when I do a psql < tsearch2.sql, it complains:
> > bash-2.05a$ psql testdb < tsearch2.sql 
> > ERROR:  stat failed on file '$libdir/tsearch2': No such file or directory
> > Where did I do wrong??
> 
> Did you do "make install" after building tsearch2?
> 
> If you did, maybe it installed tsearch2.so in the wrong place?
> ("pg_config --pkglibdir" will tell you what the backend thinks
> "$libdir" means.)
> 
>             regards, tom lane
> 


Re: tsearch2 question

From
Tom Lane
Date:
Wei Weng <wweng@kencast.com> writes:
> When I run psql < tsearch2.sql, is psql going to substitute $libdir 
> internally with what $libdir really is (in my case, it would be 
> /usr/lib/pgsql)? 

Not psql, the backend.  The point of this is that your CREATE FUNCTION
definition can be platform-independent ...
        regards, tom lane


Re: tsearch2 question

From
Wei Weng
Date:
When I ran psql testdb < untsearch2.sql

I got the following error message:

psql:untsearch2.sql:15: ERROR:  RemoveAggregate: aggregate stat(tsvector) 
does not exist

I didn't really do anything before this. Only dropped the trigger and gist 
index I created (in order to use tsearch2), and alter table testtb drop 
column idxtest tsvector.

Where did I do wrong?

Thanks

Wei