Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pb6gV-0007QQ-6c for pgsql-admin@arkaria.postgresql.org; Sat, 11 Mar 2023 21:23:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pb6gT-0006FG-3G for pgsql-admin@arkaria.postgresql.org; Sat, 11 Mar 2023 21:23:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pb6gS-0006F7-KE for pgsql-admin@lists.postgresql.org; Sat, 11 Mar 2023 21:23:20 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pb6gQ-00012g-Ch for pgsql-admin@lists.postgresql.org; Sat, 11 Mar 2023 21:23:19 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4PYwrH5KQNz9sQX; Sat, 11 Mar 2023 22:23:11 +0100 (CET) Date: Sat, 11 Mar 2023 22:23:11 +0100 (CET) From: Erik Wienhold To: Holger Jakobs , pgsql-admin@lists.postgresql.org Message-ID: <1936366362.326757.1678569791083@office.mailbox.org> In-Reply-To: <74b84567-dc96-ae88-d7c0-61a600d8d575@jakobs.com> References: <509806252.274449.1678469980651@office.mailbox.org> <74b84567-dc96-ae88-d7c0-61a600d8d575@jakobs.com> Subject: Re: LOG: could not rename temporary statistics file "pg_stat_tmp/global.tmp" to "pg_stat_tmp/global.stat" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: 4PYwrH5KQNz9sQX List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 10/03/2023 19:06 CET Holger Jakobs 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