Re: Uninstalling PostgreSQL - Mailing list pgsql-cygwin
From | Frank Seesink |
---|---|
Subject | Re: Uninstalling PostgreSQL |
Date | |
Msg-id | cbc9aa$ru7$1@sea.gmane.org Whole thread Raw |
In response to | Re: Uninstalling PostgreSQL ("- Barry -" <mail@polisource.com>) |
List | pgsql-cygwin |
Barry, Basic removal of Cygwin is to shutdown any processes, reverse the order of things like installs of Windows services, then simply delete the C:\cygwin directory from Windows (e.g., via the Explorer). But from what you write, it sounds like you ripped the legs out from under yourself before you should have and you likely have gotten burned by the file permission settings in place. Typically, apps like PostgreSQL will lock down their data directories so only the user defined to run the service/daemon have rights to the files. In PostgreSQL's case, that is typically the 'Postgres' user you defined in Windows to run the postmaster service. At this stage, you've put yourself in a place where you'll need to think like a Windows admin. Making sure you are logged in with Administrative rights in Windows, do the following: 1. Using Windows Explorer to navigate to the directory above the Cygwin install. Typically this is C:\ as you usually install Cygwin in C:\cygwin. 2. RIGHT-click on the 'cygwin' folder, go to the Securities tab, and then do what is needed to take ownership of the directory tree as yourself (as Admin), and give yourself full rights to do anything, and propogate that security setting down the tree. (This may or may not work, so keep reading). 3. Delete the Cygwin folder. If you have issues, then here's the next level. Go into C:\cygwin and start removing directories from there... 'bin', 'etc', 'home', 'lib'... If you have a problem with one, skip it for now. If any, it will likely be 'var', in which is 'postgresql', in which is 'data', a directory which is locked down to the 'postgres' user. Since you likely are NOT logged in as the 'postgres' user, though you are 'god' on the box, you don't have permission to delete the files/folders. 4. At this stage, you're down to the offending directories. Drill down to the lowest level in the directory tree you can get to. At this point, you need to start right-clicking and changing the security settings to give yourself enough rights so you CAN delete directories/files, or at least enough rights to drill down further to the lowest level and THEN setting things so you can delete them. I suggest you drill down and work your way back, as sometimes lower directories do not inherit from their parents, requiring a piecemeal deletion. In the end, though, it simply comes down to this: Removing Cygwin means gutting the \cygwin directory from the drive, removing any items from your Start menu, and if you installed any services (like postmaster via cygrunsrv), then you should have first removed those services before gutting the install, and if not, it's time to drill down in the Registry and remove them by hand (services are defined in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services Pretty? No. But then, you created the situation by not reading enough first to know how to admin Cygwin. Do this kind of removal with ANY Windows application and you risk running into such things. I grant you, the fact no universal Cygwin uninstaller exists is frustrating, but on a technical level, it's borderline impossible. Cygwin provides a complete Unix environment in Windows, and as such, comes with the usual Unix admin work. Throw in that you're still in Windows, and you basically better have admin skills on both platforms. It is not a click/install affair with a pretty GUI meant for neophytes. But once you realize that it's just about files/directories, it's removal is still far easier than Windows apps which hook in hard to the Registry and, if manually removed, cause Windows to barf. Anyway, just do the above and you should be able to remove Cygwin. And please note that, while folks here are helping you, at this stage you aren't really asking about PostgreSQL under Cygwin anymore. You're asking about basic Cygwin issues, so technically these posts belong on the Cygwin mailing list. Best of luck. - Barry - wrote: >>First, check that all your cygwin services are stopped, specifically >>the cygipc service. See your services control panel. However, you >>can't remove them there, you need to either hack the registry for >>that or the ipc-daemon2.exe with the proper commandline-options. > > > I disabled Cygwin IPC Daemon 2 and postmaster. There's no other service > beginning with "cyg". Now when I try deleting the cygwin directory, instead > of the "access is denied" for cygcygipc-2.dll, I get "Cannot delete share, > access is denied," and I still get the "Error applying attributes" pop-up > about C:\cygwin\tmp\cygipc2_2 when I try unclicking read-only. > > Barry > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >
pgsql-cygwin by date: