pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: LOG: could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat"
Date: Sat, 11 Mar 2023 22:23:11 +0100 (CET)
Message-ID: <1936366362.326757.1678569791083@office.mailbox.org> (raw)
In-Reply-To: <74b84567-dc96-ae88-d7c0-61a600d8d575@jakobs.com>
References: <509806252.274449.1678469980651@office.mailbox.org>
	<74b84567-dc96-ae88-d7c0-61a600d8d575@jakobs.com>

> On 10/03/2023 19:06 CET Holger Jakobs <holger@jakobs.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





view thread (3+ messages)

Message-ID: <1936366362.326757.1678569791083@office.mailbox.org>
Permalink:  ../1936366362.326757.1678569791083@office.mailbox.org/
Also on:    postgresql.org/message-id/1936366362.326757.1678569791083@office.mailbox.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ewie@ewie.name, holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: LOG: could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat"
  In-Reply-To: <1936366362.326757.1678569791083@office.mailbox.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox