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

TODO-item: Add sleep() function, remove from regress.c

From: Joachim Wieland <joe(at)mcknight(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: TODO-item: Add sleep() function, remove from regress.c
Date: 2006-01-10 00:03:11
Message-ID: 20060110000311.GA18542@mcknight.de (view raw or flat)
Thread:
Lists: pgsql-patches
I propose the appended patch for the todo item:

* Add sleep() function, remove from regress.c

The patch also removes do_sleep() from the regression and substitues this
with the call to the new function.

I'd personally prefer to call the function pg_sleep(), but since it is
called sleep() on the TODO list and in previous discussions, I kept the
name. The internal function is called pg_sleep() however.

There was a discussion about this item in August of last year

http://archives.postgresql.org/pgsql-hackers/2005-08/msg00633.php

A few people liked the idea, Tom Lane pointed out that it's bad to have a
sleeping backend that can hold locks for a long time. Other developers
answered that this should just be documented since the user can do that
anyways very easily if he is allowed to create functions in one of the
traditional scripting languages or with busy waiting also in plpgsql.

Finally the item got added to the TODO list and nobody objected.

In the mysqlcompat project there is a sleep function that does busy waiting,
this function could profit from a sleep() function in the backend.

To the docs I introduced a new paragraph such that it is easy to find this
function and labeled the note about the locks with the "warning" tag.


Tom, can you live with that?

Other Comments?


Joachim

Responses

pgsql-patches by date

Next:From: Michael GlaesemannDate: 2006-01-10 00:04:06
Subject: Re: Proposed patch to change "missing FROM" messages
Previous:From: Tom LaneDate: 2006-01-09 23:32:48
Subject: Proposed patch to change "missing FROM" messages

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