Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

postgres could not stat file <basexxxx/xxxx> Permission denied

This is a problem using stats(), or just when calculating the database size. Using postgresql in windows 7, localhost.

The problem after doing this is:

"could not stat file "base/17436/119145": Permission denied"

I spent a lot of time trying to fix this problem, until i realise what is really the problem about.

So i'm going to answer myself.

like image 224
Ignacio Bustos Avatar asked Jan 12 '23 00:01

Ignacio Bustos


1 Answers

This could be for 2 reasons:

-User of database (login role) without enough permissions.

In this case, check if the user, for example "postgres", have all the controls and privileges active.

-If localhost, check your antivirus, Twice.

Statistics made by postgresql might be considered as a virus movement by many antiviruses (ESET in my case), is a false positive, the only solution is to locate the directory of the database (like \PostgreSQL\9.3\data) and create am exception to that directory in your antivirus software.

As you can see, this second option is not related to the database code it self.

Hope this help you.

like image 72
Ignacio Bustos Avatar answered Jan 19 '23 11:01

Ignacio Bustos