Skip site navigation (1) Skip section navigation (2)

Re: Permission Denied for 'pg_stat_tmp/pgstat.tmp' on Windows server 2003 - postgresql 8.4.6

From: "Nathan M(dot) Davalos" <n(dot)davalos(at)sharedmarketing(dot)com>
To: "Brian Fehrle" <brianf(at)consistentstate(dot)com>,<pgsql-admin(at)postgresql(dot)org>
Subject: Re: Permission Denied for 'pg_stat_tmp/pgstat.tmp' on Windows server 2003 - postgresql 8.4.6
Date: 2011-05-12 14:05:48
Message-ID: 2701CF596B80DC44815FDBFFF5881A1E01340FF4@exchange01.sharedmarketing.com (view raw or flat)
Thread:
Lists: pgsql-admin
Go to the directory in question and have it stop inheriting rights from
the parent (security tab > advanced), let it remove all the permissions
when you apply it, then assign "everyone" full to see if it helps. I
have a feeling it's your AV though since it's happening elsewhere.

Process Monitor:
http://technet.microsoft.com/en-us/sysinternals/bb896645 will help see
if your AV is accessing it if you think that's an issue. Would be
interesting to see what is going on with that file when those errors
start happening. Funky security issues like that aren't normal,
especially if you're having that happen elsewhere. 

I would run postgres as the service account that it creates with the
installer and just make sure the root directories have explicit
permissions for that service account instead of running as
administrator. 

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Brian Fehrle
Sent: Wednesday, May 11, 2011 5:54 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] Permission Denied for 'pg_stat_tmp/pgstat.tmp' on
Windows server 2003 - postgresql 8.4.6

Hi list,
     I've been doing a ton of searching on this issue, but haven't found

any information as to why I'm getting this error, and I'm convinced this

is an issue with Windows Server 2003 (or the antivirus), but thought I'd

try my luck here to see if anyone has seen this problem and knows a fix.

Unfortunately, moving off of windows onto a real OS isn't an option, so 
I need to make due with what I have.

PostgreSQL version: 8.4.6
OS: Windows Server 2003 Web Edition, Service Pack 2 (sorry)
Disk File System: NTFS


In my PostgreSQL server log, I am receiving tons of the following line:
2011-05-11 18:24:30 EDT LOG:  could not open temporary statistics file 
"pg_stat_tmp/pgstat.tmp": Permission denied

And by tons, I mean several hundred per minute. This is odd because the 
file was created by the administrator account, and the database is 
running as the administrator account.

When I try to look at the pg_stat_tmp/pgstat.tmp file's in the windows 
properties GUI, the "security" tab that should be there is nonexistent. 
It's there for any other file, and allows me to set permissions and 
ownerships of the file, but for this one it's gone.

If I reboot the entire machine, this file is no longer locked down like 
this. I've verified that the file can be accessed, is owned by 
administrator and allows all privileges to the administrator account 
before I start the database. When I start the database, everything looks

fine, however within about half an hour, the log file prints out more 
"permission denied" lines and the security tab in the files properties 
disappears.

This behavior has happened to two other files on this server, neither of

which had anything to do with the postgres cluster, so I don't think 
it's bound to just the contents of my postgresql data directory.

I have set up the antivirus (immunet 3.0 - clamav, only one i could find

that would run on a server version of windows for free) to ignore these 
directories and files, however I'm unsure how I could verify that it's 
indeed ignoring these files, or if it is mucking around with them.

This is just one issue of many I have been having while running 
postgresql on Windows Server 2003 (none of them postgres's fault), but 
it's the main one that I haven't developed a workaround for yet. Any 
suggestions, or helpful info is greatly appreciated.

- Brian F

In response to

pgsql-admin by date

Next:From: Willy-Bas LoosDate: 2011-05-12 15:39:50
Subject: [PERFORM] since when has pg_stat_user_indexes.idx_scan been counting?
Previous:From: anantha.echambadiDate: 2011-05-12 10:26:20
Subject: Postgres Incremental Bakcup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group