Link to home
Start Free TrialLog in
Avatar of dwessell
dwessell

asked on

Error in postgres SQL statement...

Hi,

I am brand new to Postgres DB's.. I have a SQL file that I'm trying to import, and it contains a few statements like:

CREATE FUNCTION lexize(oid, text) RETURNS text[]
    AS '$libdir/tsearch2', 'lexize'
    LANGUAGE c STRICT;

and when I try and run that SQLI get: ERROR:  could not access file "$libdir/tsearch2": No such file or directory..

Can someone point me in the right direction?

Thanks
David
ASKER CERTIFIED SOLUTION
Avatar of Rurne
Rurne
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dwessell
dwessell

ASKER

Rurne,

The output of pg_config --pkglibdir is '/usr/lib/pgsql'/

And the search for tsearch2.so turned up nothing...

I read the thread you pointed me towards, but I couldn't garner much information from it.. Could be because I'm still on the first cup of coffee... But I"ll come back to it shortly and try again... Any suggestions always welcome..

Thanks
David
I'll give some more information to, this might be helpful.. I'm on a VPS, using WHM and Cpanel.. I installed Postgres myself from WHM, by installing the php-pgsql RPM... Then recompiled php using the postgres switch... I'm still pretty new to linux, so probably something I didn't do :)

dw
Amendment..

I installed postgres using the informatino in this link: http://my.myriadnetwork.com/kb/questions.php?questionid=148

Then I installed the php-pgsql RMP, then recompiled PHP...

From what I can tell, I need to install Tsearch2 from source.. But I'm falling short on finding informatino on how to do that..

Thanks
David
I'm trying to complie tsearch2, but I get this error (using gmake)
 
Makefile:31: ../../src/Makefile.global: No such file or directory
Makefile:32: /contrib/contrib-global.mk: No such file or directory
gmake: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.

 
In the .src file, there is a Makefile.global.in file.. Should I remove the .in? Or do I need to modify the Makefile in the tsearch2 dir (I tried this, but it threw similar errors about another file)...
Which version of Postgres are you installing from RPM?

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html

You actually need to place the TSearch2 code within the Postgres source tree in order to compile: the Makefile.global you are missing is the one from Postgres and not from anything you'd find in the TSearch2 source tarball.

The procedure for building against a 7.4.x (and later) version is a little bit easier than a 7.3.x version.  Let me know which you are running from the tarball and we'll proceed from there.
I found a RPM of the options that matched my version, and installed it.. All is well now... Thanks for all of the suggestions!!