Skip site navigation (1) Skip section navigation (2)

Re: Uninstalling PostgreSQL

From: Frank Seesink <frank(at)mail(dot)wvnet(dot)edu>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Uninstalling PostgreSQL
Date: 2004-06-24 05:15:38
Message-ID: cbdo1u$s5n$1@sea.gmane.org (view raw or flat)
Thread:
Lists: pgsql-cygwin
- Barry - wrote:
...
> Already tried all that. I couldn't get lower than usr/share/data. I

	Hmmm.  Sounds like you're reading out of date instructions.  The 
default has been /var/postgresql/data for a bit now.  Used to be 
/usr/share/postgresql/data.

> unchecked "read only" for the data directory and clicked "apply" and still
> got "access is denied" when trying to delete it. Then when I looked at
> "sharing and security" for the data directory, it was back to "read-only".
> Whether I try undoing read-only for the directory alone or all sub
> directories, same thing. This is after I removed the password from the
> Owner's account (the only account), and removed "The registry tree
> `Software\Cygnus Solutions' under HKEY_LOCAL_MACHINE and/or
> HKEY_CURRENT_USER, " as instructed to do by Cygwin's FAQ:

	???  This just doesn't sound right.  First, I'm not referring to the 
generic read-only checkbox you see in the 'General' tab of the 
Properties dialog box.  I'm referring to the 'Security' tab where you 
specify who the owner of a file/directory is, and what rights each user 
has.  This, of course, assumes you're running under some form of Windows 
NT (NT 4, 2000, XP) and NOT the Win9x family (95/98/Me), where this kind 
of issue should not be occurring as there are no such file 
permissions/security there.

> ----------------------
> How do I uninstall all of Cygwin?
> Setup has no automatic uninstall facility. Just delete everything manually:
> 
>     * Cygwin shortcuts on the Desktop and Start Menu
>     * The registry tree `Software\Cygnus Solutions' under HKEY_LOCAL_MACHINE
> and/or HKEY_CURRENT_USER.
>     * Anything under the Cygwin root folder, `C:\cygwin' by default.
>     * Anything created by setup in its temporary working directory.
> 
> It's up to you to deal with other changes you made to your system, such as
> installing the inetd service, altering system paths, etc. Setup would not
> have done any of these things for you.
> ----------------------
> 
> And after rebooting. All this was done after trying to delete /cygwin from
> the postgres user's account (before I deleted the account).

	"after trying to delete /cygwin from the postgres user's account 
(before I deleted the account)"?  What does this mean?  You do not 
delete a directory from an account.  Windows is a monolithic directory 
structure, where you have permissions set on who can access what 
folder/file.  If you deleted C:\cygwin, it's gone from the system, not 
from an account.  You do understand this, right?

...
> I did pop in on the current Uninstalling cygwin thread in the Cygwin mailing
> list. At http://cygwin.com/ml/cygwin/2004-06/msg00974.html it says:
> 
> "...first kill all running cygwin programs and services. killall script in
> distro and automatic detection of cygwin services
>    still pending."
> 
> So, I don't know what to kill. I figured the problem might be due to
> PostgreSQL because of various permissions I had to set (though I never
> risked doing "chmod a+rw /var/log # could adversely affect other daemons" as
> it says at
> http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4.README),
> and because there might be some other special database locking or encryption
> going on.

	Ok, last time.  Basic Windows admin step here.  RIGHT-click in a blank 
area of the taskbar and choose 'Task Manager' from the popup menu. 
Click the 'Processes' tab in the Windows Task Manager that appears. 
This should list every running process in your system.  Click the 'Image 
Name' column a few times until the list is sorted alphabetically.  This 
makes it easier to see what's truly running on your computer.

	Do you see processes with image names like 'cygrunsrv.exe', 
'cygserver.exe', 'ipc-daemon2.exe' or 'postgres.exe'?  If so, click once 
on each to highlight, then click [End Process] to kill.  Now try to 
delete the remaining Cygwin files.

> I'm thinking of downloading Cygwin again and playing with permissions from
> that console. Yesterday chmod and chown didn't give me an error from the
> Windows command prompt, but today they do. Or maybe I'll add postgres as a
> user again and try stuff from that account.

	That won't work.  Windows NT/2000/XP does not work the way you appear 
to think that it does.  Speaking strictly Windows NT/2000/XP here, when 
you create a user, Windows generates what is known as a RID (Relative 
ID), basically a local 'Social Security Number' if you will.  It then 
adds this to the system's SID (System ID), another randomly generated 
number which was created when this copy of Windows was installed.  The 
SID/RID defines the user, much like a SSN.  The name you see (e.g., 
'postgres') is purely for your benefit.  All the internal references to 
the user, such as a file/directory that the user has rights to, stores 
only the user's RID.

	When you delete a user, you basically unhook the name from the RID.  If 
you then right away create a new user with the same name, guess what? 
That's not the same user.  Sure, the name appears the same.  But since 
you had to create a 'new user', Windows generated a new RID.  Again, 
much like a second Bob coming to work at the same office.  What sets the 
Bobs apart is their SSN.

	Anyway, deleting and then creating a user in Windows won't help you, 
because whatever file permissions were set are defined for the OLD user, 
who is now gone.

> The Cygwin directory appears to take up only 8K, so I guess it's not that
> bad anyway.

	If Cygwin is only taking 8K, then likely you simply need to learn how 
to take ownership of a file/directory and then set the rights of that 
file/directory so you, as your current user, have rights to hose it. 
This is a Windows level issue, not Cygwin.

	You do not seem to grasp this concept, though.  If you are truly logged 
into Windows NT/2000/XP as a user who is either the built-in 
Administrator account or a user that is a member of the 'Administrators' 
group (meaning you're just as powerful as the Administrator account), 
you are "god on the box" as it were.  All you have to do is take 
ownership of the Cygwin files/folders, then set the rights so you have 
'Full Control'.  Then delete them.


In response to

Responses

pgsql-cygwin by date

Next:From: - Barry -Date: 2004-06-24 08:32:46
Subject: Re: Uninstalling PostgreSQL
Previous:From: mike gDate: 2004-06-24 01:43:59
Subject: Re: Getting the new cygserver to run

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group