From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)atentus(dot)com> |
Cc: | C F <tacnaboyz(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Limiting User Resources |
Date: | 2002-08-21 17:14:46 |
Message-ID: | 200208211714.g7LHEk828465@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
You could hack the guc.c file in 7.3 to make the timeout setting (which
is per statement) to be unsettable by users and set it in
postgresql.conf; interesting idea.
---------------------------------------------------------------------------
Alvaro Herrera wrote:
> C F dijo:
>
> > Hello,
>
> > Does PostgreSQL have anything similar? I'd be perfectly happy with
> > simply being able set a timeout on SQL queries (where after a certain
> > amount of time the query is cancelled and the resources it was using
> > are freed).... I'd like to know what options there are. If not
> > natively available in the the database are there 3rd party products or
> > techniques you can suggest? Basically I'm looking at allowing users
> > to enter their own queries through a web interface and I'm worried
> > about people writing bad queries and hogging up the resources and
> > effectively shutting down the site!
>
> In the current development version there is a mechanism to set up
> timeouts for queries (or was that transactions? I don't remember). Note
> however that the user has the ability to change it, so you can't really
> control malicious users this way.
>
> If your users are going to have full freedom to do whatever they want,
> there's no way you can control them. If however you are going to put
> some restrictions (say add a begin/end transaction markers, disallow
> using semicolons and single quotes in queries, etc) you can use the
> timeout.
>
>
> It would be nice if there was a way to limit the resources used, for
> universities and such.
>
> --
> Alvaro Herrera (<alvherre[a]atentus.com>)
> "Now I have my system running, not a byte was off the shelf;
> It rarely breaks and when it does I fix the code myself.
> It's stable, clean and elegant, and lightning fast as well,
> And it doesn't cost a nickel, so Bill Gates can go to hell."
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2002-08-21 17:24:24 | Re: [HACKERS] [GENERAL] workaround for lack of REPLACE() |
Previous Message | Alvaro Herrera | 2002-08-21 17:09:27 | Re: Limiting User Resources |