On Thu, Mar 13, 2014 at 2:28 PM, Yong Zhang <yzhang@trinityusa.com> wrote:
> You're correct. The installer script doesn't try to change ownership directly. But it does it in an indirect way via
initdb.exe.Here is what I got when I ran initdb.exe in the command window:
>
>
> "C:\Program Files (x86)\PostgreSQL\9.1\bin\initdb.exe" --pwfile="password.txt" --locale="English_United States"
--encoding=UTF-8-A trust -U postgres -D "C:\Program Files (x86)\PostgreSQL\9.1\data"
> The files belonging to this database system will be owned by user "yzhang".
> This user must also own the server process.
>
> The database cluster will be initialized with locale English_United States.
> The default text search configuration will be set to "english".
>
> fixing permissions on existing directory C:/Program Files (x86)/PostgreSQL/9.1/data ... initdb: could not change
permissionsof directory "C:/Program Files (x86)/PostgreSQL/9.1/data": Permission denied
>
> This is the exact error in the log file I got when I ran the installer. I don't understand why it tried to change the
ownershipof data folder to me. All it needs is the permissions!
>
If you check the initdb source code, you'll see it just calls chmod,
not chown or any of it's related functions as far as I can see. That's
also implied by the message you quote above: could not change
*permissions* of directory.
I don't see anything in initdb OR the installer that can change
directory ownership on Windows.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company