PostgreSQL problem: could not access file "$ libdir / plpgsql": no such file or directory

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 of the solutions point to the wrong installation. But this is my test db, which works without problems for a long time. Inserts are also inserted. The problem only occurs when selecting queries.

+7
source share
3 answers

Apparently, you have moved your PostgreSQL lib folder 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 will need to find out where these files ended up, or you can reinstall PostgreSQL to recover them.

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

 pg_config --pkglibdir 

For me, this produces:

 /usr/lib/postgresql 
+6
source

I have the same problem: another postgres server instance (8.4) interfered with 9.1; when instance 8.4 is removed, it works.

+2
source

another instance can sometimes be deleted from the system during operation (for example, you update gentoo and depclean without stopping and transferring your data). therefore, the error seems especially mysterious.

the solution will usually install / uninstall the slot of the old version (in terms of gentoo or simply downgrade on other distributions), run pg_dumpall, and then uninstall / reinstall the new version and import the data.

it worked painlessly for me

-one
source

All Articles