Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL issue: could not access file "$libdir/plpgsql": No such file or directory

Tags:

postgresql

I get this exception in PostgreSQL:

org.postgresql.util.PSQLException: ERROR: could not access file "$libdir/plpgsql": No such file or directory
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1721)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1489)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:193)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:337)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:236)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)

I searched a lot and most solution points to a wrong installation. But this is my test db which has been running without issues for a long time. Also inserts are working. Issue occurs only on select queries.

like image 756
rajesh Avatar asked Jul 29 '11 13:07

rajesh


2 Answers

Apparently, you moved your PostgreSQL lib directory out of place. To confirm this, try the following in psql:

> SET client_encoding TO iso88591;
ERROR:  could not access file "$libdir/utf8_and_iso8859_1": No such file or directory

If you get an error message like this, then my theory is correct. You'll need to find out where those files ended up, or you can reinstall PostgreSQL to restore them.

To find out what $libdir is referring to, run the following command:

pg_config --pkglibdir

For me, this produces:

/usr/lib/postgresql
like image 142
Joey Adams Avatar answered Nov 16 '22 20:11

Joey Adams


I have the same problem: the other postgres server instance (8.4) was interfering with the 9.1 one; when the 8.4 instance is removed it works.

like image 2
user1410433 Avatar answered Nov 16 '22 19:11

user1410433