Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

518
Visualizações
PostgreSQL ERROR: could not access file "$libdir/postgis-2.5"

I've got a database with postgis installed, but it doesn't work anymore:

# SELECT PostGIS_full_version();
ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT:  SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 26 at SQL statement

I found other answers which suggested running ALTER EXTENSION postgis UPDATE;, so I did, but it has no effect:

my_db=# ALTER EXTENSION postgis UPDATE;
NOTICE:  version "2.5.4" of extension "postgis" is already installed
ALTER EXTENSION
my_db=# 
my_db=# SELECT PostGIS_full_version();
ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT:  SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 26 at SQL statement

Does anybody have any idea on how to solve this?

(I'm on Ubuntu 20.04 with Posrgresql version 12.3. and I recently upgraded from Ubuntu 19.10 to 20.04, which I *think is when this started to be a problem)

[EDIT]

I searched in apt, and found this package which I didn't have installed yet: postgresql-12-postgis-2.5. So after installing that (sudo apt install postgresql-12-postgis-2.5) I restarted postgresql (sudo service postgresql restart) and tried again, but I still get the same error.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I wanted to post this as a comment but I don't have enough reputation for that. I had a very similar problem and explained in detail how I solved if over here. I hope this also helps you.

over 4 years ago · Santiago Trujillo Relatório

0

It happened the same to me, after upgrading to Ubuntu 20.04.

Usually a postgresql major upgrade do not replace the previous version, because the dabatase has to be dumped and restored. The new version is installed alongside the old one, and at the new server is assigned a different port. Is up to the user to migrate the old database to the new version.

In my case, the upgrade, for some reason, removed the postgis-2.5 library in the previous postgresql version, leaving a broken postgis installation in the old database (and no installation in the new one, of course.)

It's easy to be confused and connect to the wrong server; at least, I was easly confused and so received the same error message even after having installed postgis for the new postgresql version. I discovered the problem checking pg_lsclusters and understanding which server was listening on which port.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda