Delete old PostgreSQL data directory in win7

I cannot delete the old data directory in Windows 7. I have already uninstalled PostgreSQL, but there is also a "postgres" system user account, which is the only one with permissions to the folder.

a possible solution would be to develop a service running as user "postgres" that deletes the folder, but there should be an easier way?

+1


a source to share


5 answers


I haven't used Windows 7, but if I remember correctly, there must be a way to start an explorer session (file manager, not IE) as a Postgres user and then delete it.

Otherwise, you can, logged in as an administrator, add administrator rights to change this directory and the parent directory, after which you can delete it.

I'm not sure if the administrator will be able to delete the directory directly, but it should be possible for him to add rights to that.



Update : I just installed PostgreSQL and tested it on Vista, it may work the same on Windows 7. It looks like they fixed the permissions stuff, so the tip above does not work (change permissions).

However, if the system account still exists, you can access it in Computer Management. Add it to your normal user group (like Users or Administrators) and then you can login to it and delete the directory after that.

0


a source


Simple. Just open Command Prompt as administrator and type

net user

      

Then press the return key, you will see the user accounts in your OS. Also you will notice that the postgres were listed there. To remove it, enter the following: -



net user postgres /del

      

And the return key. Voila, everything is ready. To make sure everything is complete, check your USERS folder on the C: drive, or whichever is relevant, and delete the postgres folder if present. Done! :)

+8


a source


As an administrator, take responsibility for the appropriate directory - in Windows Explorer - right-click on it, Properties, Security, Advanced, Owner, and in the Change Owner To list, select your account. Then remove it.

0


a source


You must also delete the user.

Open a command prompt and enter net user "user login" / delete

0


a source


The post look is old, but if what is intended is the same as I assumed (delete the postgres account) the solution could be as follows:

  • Open cmd as administrator
  • Run the command: net user postgres /delete

0


a source







All Articles