Subject: how to kill locked jobs ?

From: Ken Dueker <[email-masked]>
Date: Sun, 27 Mar 1994 17:41:32 -0800

i have gotten into situations were the back-end has locked
up when i accidentally re-define index's. Unfortunately,
these jobs are owned by root - and without su password
i cannot kill these hung jobs. I have combed the doc
for clues as to how to change the ownership of the back-end
job to little avail ... any suggestions ?

ken

---

From: [email-masked] (Paul M. Aoki)
Date: Sun, 27 Mar 94 19:24:18 -0800

> job to little avail ... any suggestions ?

once a process is running as someone, you can't change it to 
someone else.  that's purely a unix thing, not a postgres 
thing.  the *process* can change its own user id, if the 
executable already has the setuid bit set.  if it's spinning,
there's nothing you can do except kill it as root.  if it's
hung (disk wait or zombie), you can probably only reboot the 
machine.

if you aren't sure what i'm talking about, your sysadmin can
point you at the right unix documentation.

general advice:
don't run postgres as root.  never, ever, ever, ever.  you 
need to talk to your system administrator or whoever installed 
postgres.  postgres should not have to be setuid and it should 
definitely (did i say this before?) never, ever be run as root.

example badness: postgres lets you load arbitrary object code
into a process running as (in your case) root.  someone could
load some code into the backend that removes *your* home
directory.

this is also why it's a bad idea to install postgres as "you"
instead of creating a postgres user.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki