3

I have to postgres 11 and 14 installed on my computer. When I run pg_upgrade to migrate the databases I get the following error:

PANIC: could not open control file "global/pg_control": Permission denied

However if I give the Window User full control of data directories of 11 and 14, then the upgrade works. Can someone help me what am I doing wrong since I am running pgupgrade from powershell started as admin.

Fab C
  • 65
  • 1
  • 6
  • Then where is the problem? Just give the user that runs the command the appropriate permissions. – Laurenz Albe Dec 16 '21 at 10:38
  • We have multiple installations on different systems. I cannot keep giving permissions on every system. What I cannot understand why would the Window User even need any permission if pg_upgrade is being run by powershell in administrative mode. Certainly there is something wrong I am doing here. – Fab C Dec 16 '21 at 10:59
  • I understand too little about Windows permissions. Why don't you run as the user that owns `pg_control`? – Laurenz Albe Dec 16 '21 at 12:01
  • Owner is SYSTEM since all installations are owned by SYSTEM. I can either run it as an Admin or User (without doing fancy hacks or installing 3rd party stuff). Why is there a dependency on User rights is what I do not understand. Administrators have full access to modify anyway. – Fab C Dec 16 '21 at 12:26
  • This restriction is not from the PostgreSQL software, but from the operating system. So you must have got something wrong concerning the permissions. – Laurenz Albe Dec 16 '21 at 13:56

1 Answers1

0

If your upgrade is failing with Powershell runas Admin then you would need to check for permissions for Administrators Group on the folder. As you have verified that when windows account has full control, the migration works with powershell runas windows account

Harry B
  • 1
  • 1