Re: LOG: could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat"

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Holger Jakobs <holger(at)jakobs(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: LOG: could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat"
Date: 2023-03-11 21:23:11
Message-ID: 1936366362.326757.1678569791083@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On 10/03/2023 19:06 CET Holger Jakobs <holger(at)jakobs(dot)com> wrote:
>
> What is a bit problematic running PostgreSQL on Windows is that the
> installer by EDB doesn't create a new system user 'postgres' like
> ususally is done by the package systems on Linux systems making this
> system user the owner all directories and files of the database clusters
> with exclusive permissions.

Yeah, that also bugs me because I have to manage the password for the initial
superuser.

> Instead, the postgres.exe processes are run as an 'NT service', which is
> also used by a lot of non-postgres processes. These processes have the
> same permissions on Postgres' files as the Postgres processes.
>
> When I set up a lot of PostgreSQL servers on Windows machines a couple
> of years ago, I had a script create a special user for the database
> system and also made this special user the owner of all files and
> directories of the clusters.

Thanks for the tip.

> I am afraid that some non-postgres process might have meddled with the
> Postgres cluster causing trouble.

My guess is Symantec Endpoint Protection because in the past it detected the
EnterpriseDB installer and PostGIS installer as false-positive around 50% of
the time. Seems plausible that it detected pg_ctl.exe after I updated to 14.7.

> Maybe you can check ownership and permissions of the respective files.
> Unfortunately, the permissions system on Windows is far more complex
> than the one on Linux with just user owner, group owner and the
> permissions r, w and x.

* Owner of c:/program files/postgresql/{12,14} is group "Administrators" which
has a couple of users. Also owns everything under bin/.

* User "NETWORK SERVICE" is owner of most of the files under data/ with some
files owned by the user who installed Postgres (myself in case of pg14, some
other user in case of pg12).

--
Erik

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Alexey Murz Korepov 2023-03-12 05:52:00 Re: Ways to change a database collation with removing duplicates
Previous Message Tom Lane 2023-03-11 20:53:23 Re: Ways to change a database collation with removing duplicates