Re: Sleep functions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Adler <adler(at)pobox(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Sleep functions
Date: 2005-08-22 14:02:15
Message-ID: 200508221402.j7ME2Fr07836@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Adler wrote:
> On Sun, Aug 21, 2005 at 09:13:20PM -0400, Tom Lane wrote:
> > Michael Fuhr <mike(at)fuhr(dot)org> writes:
> > > What do people think of exposing pg_usleep() to the user?
> >
> > I'm not real enthused about it. Generally speaking, a sleep() on the
> > database side means you are idling while holding locks, and that does
> > not seem like something we want to encourage people to do.
> >
> > As other responders noted, it's trivial to program this in any of the
> > untrusted PL languages, So what you're really proposing is that we give
> > sleep() to non-superusers, and that seems like a bit of a hard sell.
> > Let's see a use-case or three.
>
> There may be a better alternative, but wouldn't this let application
> writers easily test the effects of a long running transaction?

What is wrong with giving non-super-users sleep() access? It is a
natural part of almost every programming language.

--
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-08-22 14:03:37 Re: Missing CONCURRENT VACUUM (Was: Release notes for
Previous Message Andrew Dunstan 2005-08-22 13:57:58 Re: [HACKERS] PostgreSQL 8.0.3 and Ipv6