[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error in postgres SQL statement...

Posted on 2007-07-20
7
Medium Priority
?
932 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:dwessell
  • 5
  • 2
7 Comments
 
LVL 9

Accepted Solution

by:
Rurne earned 500 total points
ID: 19535692
It looks as if either TSearch2 is not installed, or $libdir is pointing to the wrong place.

To get the value for $libdir, can you give me the output of running `pg_config --pkglibdir` at shell prompt?

After that, try running `locate tsearch2.so` to find out if TSearch2 is installed, and if it is, if it's in the folder that is returned by running `pg_config --pkglibdir`.


There's a good discussion of this exact issue on the pgsql-sql archives:
http://archives.postgresql.org/pgsql-sql/2003-09/msg00315.php
0
 

Author Comment

by:dwessell
ID: 19538239
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
0
 

Author Comment

by:dwessell
ID: 19538342
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dwessell
ID: 19540227
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
0
 

Author Comment

by:dwessell
ID: 19540574
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)...
0
 
LVL 9

Expert Comment

by:Rurne
ID: 19549264
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.
0
 

Author Comment

by:dwessell
ID: 19558230
I found a RPM of the options that matched my version, and installed it.. All is well now... Thanks for all of the suggestions!!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What we learned in Webroot's webinar on multi-vector protection.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question