pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Clarification of initdb ownership requirement on Windows
3+ messages / 3 participants
[nested] [flat]

* Clarification of initdb ownership requirement on Windows
@ 2026-11-09 02:01  Jc Cipriano <carlocipriano20@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Jc Cipriano @ 2026-11-09 02:01 UTC (permalink / raw)
  To: pgsql-docs

Hello PostgreSQL Documentation Team,

I would like to request clarification regarding the following statement in
the PostgreSQL 18 documentation for initdb:

initdb must be run as the user that will own the server process, because
the server needs to have access to the files and directories that initdb
creates. Since the server cannot be run as root, you must not run initdb as
root either. (It will in fact refuse to do so.)

I could not find a Windows-specific explanation of what constitutes the
required ownership identity.

Could you clarify which interpretation is intended for Windows?

   1.

   *Same-account requirement:* The Windows account that executes initdb
   must also be the Windows account under which the PostgreSQL server process
   subsequently runs.
   2.

   *Access-based requirement:* The accounts may differ, provided that the
   Windows account running the PostgreSQL server has the necessary access to
   the initialized data directory and related files.

If the intended behavior differs between Windows and Unix-like platforms,
it would also be helpful to clarify that distinction.

I also found a November 2022 discussion that touched on this paragraph, but
I could not find a definitive resolution of the Windows-specific question.

This question is particularly relevant to Windows installations that
register PostgreSQL as a Windows service using a dedicated service account.

I am not proposing a specific implementation or documentation change at
this stage. I would first like to understand the intended and supported
behavior.

Thank you for your time and for maintaining PostgreSQL documentation.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Clarification of initdb ownership requirement on Windows
@ 2026-11-09 14:32  David G. Johnston <david.g.johnston@gmail.com>
  parent: Jc Cipriano <carlocipriano20@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: David G. Johnston @ 2026-11-09 14:32 UTC (permalink / raw)
  To: Jc Cipriano <carlocipriano20@gmail.com>; +Cc: pgsql-docs

On Mon, Nov 9, 2026 at 5:48 AM Jc Cipriano <carlocipriano20@gmail.com>
wrote:

> Hello PostgreSQL Documentation Team,
>
> I would like to request clarification regarding the following statement in
> the PostgreSQL 18 documentation for initdb:
>
> initdb must be run as the user that will own the server process, because
> the server needs to have access to the files and directories that initdb
> creates. Since the server cannot be run as root, you must not run initdb as
> root either. (It will in fact refuse to do so.)
>
> I could not find a Windows-specific explanation of what constitutes the
> required ownership identity.
>
Aside from the root restriction on Linux there is none.  PostgreSQL itself
doesn't make any additional checks of its own.  If the operating
environment permits the necessary actions the server will work.  The most
expedient way is to ensure whatever runs initdb also executes pg_ctl.

> Could you clarify which interpretation is intended for Windows?
>
>    1.
>
>    *Same-account requirement:* The Windows account that executes initdb
>    must also be the Windows account under which the PostgreSQL server process
>    subsequently runs.
>    2.
>
>    *Access-based requirement:* The accounts may differ, provided that the
>    Windows account running the PostgreSQL server has the necessary access to
>    the initialized data directory and related files.
>
>
Option 2

David J.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Clarification of initdb ownership requirement on Windows
@ 2026-11-09 14:47  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jc Cipriano <carlocipriano20@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2026-11-09 14:47 UTC (permalink / raw)
  To: Jc Cipriano <carlocipriano20@gmail.com>; +Cc: pgsql-docs

Jc Cipriano <carlocipriano20@gmail.com> writes:
> Could you clarify which interpretation is intended for Windows?

>    1.
>    *Same-account requirement:* The Windows account that executes initdb
>    must also be the Windows account under which the PostgreSQL server process
>    subsequently runs.
>    2.
>    *Access-based requirement:* The accounts may differ, provided that the
>    Windows account running the PostgreSQL server has the necessary access to
>    the initialized data directory and related files.

I recommend following option 1.  Option 2 might accidentally work
today, but it doesn't map to what we expect on Unix-oid systems,
and nobody here is going to shed a tear if we break it.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-11-09 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 02:01 Clarification of initdb ownership requirement on Windows Jc Cipriano <carlocipriano20@gmail.com>
2026-11-09 14:32 ` David G. Johnston <david.g.johnston@gmail.com>
2026-11-09 14:47 ` Tom Lane <tgl@sss.pgh.pa.us>

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