could not rename temporary statistics file “pg_stat_tmp/global.tmp” to “pg_stat_tmp/global.stat”: Permission denied

PostgreSQL

Linux Server에서 동작하는 PostgreSQL서버를 $PGDATA\postgresql.log와 Windows Server에서 동작하는 PostgreSQL서버의 %PGDATA%\postgresql.log를 감시하다 보면 유독 Winodws Server에서만 다음과 같은 경고 메시지가 출력되는 경우가 있습니다.

could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat": Permission denied
using stale statistics instead of current ones because stats collector is not responding

기술적 주요 원인

Windows는 다른 프로세스가 열려 있는 동안 파일의 이름을 바꾸거나 파일을 제거할 수 없습니다. Linux(또는 Unix)는 프로세스가 파일에 액세스하는 동안 파일의 이름을 바꾸거나 제거할 수 있습니다. 이 차이점으로 Windows의 PostgreSQL에서 백그라운드에서 동작하는 통계 수집기가 “pg_stat_tmp/global.tmp”이름을 “pg_stat_tmp/global.stat”로 변경하는 경우 다른 프로세스에서 “pg_stat_tmp/global.tmp”를 잡고 있을경우 Permission denied이 발생할 가능성이 있습니다.

참고 사이트

28.2. The Cumulative Statistics System
28.2.The Cumulative Statistics System # 28.2.1. Statistics Collection Configuration 28.2.2. Viewing Statistics 28.2.3. p...

PostgreSQL statistics issue - could not rename temporary statistics file
I am running PotgreSQL 9.4 on Windows, and constantly get the error, 2015-06-15 09:35:36 EDT LOG could not rename tempor...
제목과 URL을 복사했습니다