PostgreSQL issue: could not access file "$libdir/plpgsql": No such file or directory - 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.

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

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.

the other instance can sometimes be removed from the system while still running (e.g. you do a gentoo update and a depclean without stopping and migrating your data). so the error seems particularly mysterious.
the solution is usually going to be doing a slot install/eselect of the old version (in gentoo terms, or simply downgrading on other distros), running its pg_dumpall, and then uninstalling/reinstalling the new version and importing the data.
this worked pretty painlessly for me

Related

pg: unknown authentication message response: 10 (Golang) [duplicate]

I'm trying to follow the diesel.rs tutorial using PostgreSQL. When I get to the Diesel setup step, I get an "authentication method 10 not supported" error. How do I resolve it?
You have to upgrade the PostgreSQL client software (in this case, the libpq used by the Rust driver) to a later version that supports the scram-sha-256 authentication method introduced in PostgreSQL v10.
Downgrading password_encryption in PostgreSQL to md5, changing all the passwords and using the md5 authentication method is a possible, but bad alternative. It is more effort, and you get worse security and old, buggy software.
This isn't a Rust-specific question; the issue applies to any application connecting to a Postgres DB that doesn't support the scram-sha-256 authentication method. In my case it was a problem with the Perl application connecting to Postgres.
These steps are based on a post.
You need to have installed the latest Postgres client.
The client bin directory (SRC) is "C:\Program Files\PostgreSQL\13\bin" in this example. The target (TRG) directory is where my application binary is installed: "C:\Strawberry\c\bin". My application failed during an attempt to connect the Postgres DB with error "... authentication method 10 not supported ...".
set SRC=C:\Program Files\PostgreSQL\13\bin
set TRG=C:\Strawberry\c\bin
dir "%SRC%\libpq.dll" # to see the source DLL
dir "%TRG%\libpq__.dll" # to see the target DLL. Will be replaced from SRC
cp "%SRC%\libpq.dll" %TRG%\.
cd %TRG%
pexports libpq.dll > libpq.def
dlltool --dllname libpq.dll --def libpq.def --output-lib ..\lib\libpq.a
move "%TRG%"\libpq__.dll "%TRG%"\libpq__.dll_BUP # rename ORIGINAL name to BUP
move "%TRG%"\libpq.dll "%TRG%"\libpq__.dll # rename new DLL to ORIGINAL
At this point I was able successfully connect to Postgres from my Perl script.
The initial post shown above also suggested to copy other DLLs from source to the target:
libiconv-2.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
libintl-8.dll
However, I was able to resolve my issue without copying these libraries.
Downgrading to PostgreSQL 12 helped

Connect Postman to Postgres

There is a problem.
I need to access Postgres Database from Postman. Database isn't local, it is on a server, but I have full connection string (host, db_name, user_name/password, scheme).
Any chances to do it?
I tried PostgREST, but I can't install it. I have LIBPQ.dll is not found error. I installed it but it was no help, I still have 0xc00007b error.
So that I can't install PostgREST.
Should I install it on the server where DB is located?
And is there any other way?
update: I managed to overcome all the errors (here is the note how to overcome 0xc00007b error: https://postgrest.org/en/stable/install.html).
Now I can call postgrest from cmd with the flag --help, but it's still not connected to the database.
update2: I managed the connection by putting postgrest.conf filled file in the same directory as postgrest.exe file and running in from cmd.
search for app and browser control in start menu, then select exploitation control :
set randomize image ASLR to off

Where to find postgresql.log on Manjaro

Using Manjaro, I freshly installed PostgreSQL with an user-defined data-directory. PostgreSQL is running fine, but I can't find the postgresql*.log(s), which I used to find in /var/log/postgresql on my former system. In ksystemlog I've seen an error, that I forced by
select * from non_exist_table;
but I'm wondering, if there is no longer the postgresql*.log.
Thank you!
Here is my postgresql.conf.
With logging_collector=off, the logs will just spew to the stderr of the postmaster process. That could have been redirected to a file, or just going to some tty someplace, or just be thrown away. You would have to look at the code which launches the database server.

Postgres database cluster initialization failed on windows upon installation?

I'm trying to install postgreSQL on my windows 10 computer for the first time. I got an error at the end of the installation saying that there was a "problem running post-install step. Installation may not complete correctly. The database cluster initialization failed."
When I run the sql shell I get an error trying to do the default login that says 'chcp' is not recognized as an internal or external command. I set the environmental path variable to the bin of the Postgres folder in my program files. I also tried a number of other (but very dated) solutions to similar problems users experienced such as moving my data directory outside of the Postgres directory entirely. Most of these solutions date back to 2012 and don't seem to work anymore.
The one that seemed closest to working is postgresql installation failed.
However, I can't find "postgres" as a user. I get an error saying:
"An object named "postgres" cannot be found. Check the selected object types and location for accuracy and ensure that you typed the object name correctly, or remove this object from the selection."
Does anybody have any updated solutions/tips for this?

Not able to start Sphinx Search- error 1067

I am trying to install the Sphinx Search Server. I followed the steps given here http://itsonrail.wordpress.com/2010/05/23/installing-sphinx-on%C2%A0windows/
I added C:\Sphinx\bin to environment path and Sphinx Search is listed in the Services panel. When I try to start it, this error occurs:
Windows could not start SphinxSearch service on local computer
Error: 1067 The process terminated unexpectedly.
Please help me solving this problem. Thanks in advance.
I trid this http://sphinxsearch.com/forum/view.html?id=2684 but it didn't help.
I had the same error in my Windows 7 x64. The step below helped to solve my problem:
Create folders data and log in C:\Sphinx.
Then try to start sphinx with cmd:
C:\sphinx\bin>searchd
I have faced the same problem and eventually moved the sphnix.conf to C:\Sphinx\bin\sphnix.conf from root and the services starts. Please try this. (Please make sure there are data\, log\ directories in the root with write permission)
It is looking like your configuration is not setup properly. Have you tried to run search daemon from sphinx directory path via command prompt?
C:\sphinx\bin> searchd
C:\sphinx\bin>indexer --rotate –all
Also please ensure the log via search.log or windows event log.
If it is not running after this than try to reinstall it again
I hope it will work for you
Error 1067 doesn't say much about the problem, except that the process terminated unexpectedly. Try looking some more informations in searchd.log.
I've got same error code when I tried to update Sphinx with newer version.
In the log file, I've found
FATAL: no valid indexes to serve
My problem was that I tried running new version of Sphinx using index files created with an older version. It was solved by deleting all old index files and creating new indexes.
==>> close your cmd window and restart the sphinxsearch service...
I got this error suddenly, when Shpinx was working fine yesterday. Turns out the query log file was hitting 4Gb in size. I deleted it, and service started with no problems.
Make sure all the folders defined in the conf file actually exist. I was missing the LOG folder and that's why I was getting the error. Once I added the folder, the problem was solved.