pg_database_size issue an error (ERROR: could not stat file "base/16384/20041": Permission denied)

Поиск
Список
Период
Сортировка
От Christophe GUILLOT
Тема pg_database_size issue an error (ERROR: could not stat file "base/16384/20041": Permission denied)
Дата
Msg-id CAJHRyAEJhwvHE25nk+-GBKZnMPWy8O9UhR3XgTw9SJc+7oZmZA@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi all,
The usage of the pg_database_size function generate a lot of "permission denied" log errors. 
Typical message is: ERROR:  could not stat file "base/16384/20041": Permission denied.

As a short description:
- PostgreSQL 9.2.1/64 bits
- our system is running on windows platform (W7, W2008) 
- frequent alter/create/drop of tables
- call to pg_database_size, sometimes.

When logging file system activity (using procmon, W7), the query made on the file printed in the log message return a “DELETE PENDING” state and i only find a handle to this file owned by a postgres executable.

After code exploration, it looks like the functions from "dbsize.c" should use the same trick as found in "md.c" (i mean the FILE_POSSIBLY_DELETED macro) for testing each "stat()" returned error code.

So, is it a good idea to patch dbsize.c with the same macro, which on windows platform include the EACCES error code as a possibly deleted file, or not. Or is it the wrong way ? I didn't try to patch yet.

Thanks for your help,

Christophe

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Shuffling xlog header files
Следующее
От: Robert Haas
Дата:
Сообщение: Re: MySQL search query is not executing in Postgres DB