Hi every one.

One of my customer has made a big mistake on one of his databases and that
made me think (a little bit)

The mistake was really simple: he wrote a plpgsql function that looped
indefinitly.

I have restarted the database and every think went back normal but I
wonder how a joe user could stop his own backend. (this wasn't triggered
by psql but on the web by php).

The fact that the postgres user owns all the backend makes it impossible
for ordinary users to kill their backend or have I missed something?

Is there a solution?

-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

Mon, 19 May 2003 13:59:21 +0200 (MET DST)
ohp@pyrenet.fr
Interessting problem
On Mon, May 19, 2003 at 01:59:21PM +0200, ohp@pyrenet.fr wrote:
> The fact that the postgres user owns all the backend makes it impossible
> for ordinary users to kill their backend or have I missed something?
 
FWIW, DB2 gives the option of a function being 'fenced' or 'un-fenced'.
Un-fenced functions run in the database process, so if they do something
bad they can cause serious data corruption. Fenced functions are run in
a separate process, and using a separate uid. AFAIK, communication
between the two is done using IPC. The downside to fenced functions is
that they are slower, due to fork and IPC overhead (I don't remember if
DB2 will cache fence processes and re-use them or not).
-- 
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

Tue, 20 May 2003 10:07:17 -0500
"Jim C. Nasby" <jim@nasby.net>
Re: Interessting problem