Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 33FB89FB21E for ; Thu, 2 Nov 2006 15:52:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 30399-09 for ; Thu, 2 Nov 2006 15:52:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from denzel.in (gw1.sciencetools.com [64.2.32.210]) by postgresql.org (Postfix) with ESMTP id D55FA9FB2A7 for ; Thu, 2 Nov 2006 15:52:06 -0400 (AST) Received: from localhost (rtroy@localhost) by denzel.in (8.9.3/8.8.7) with ESMTP id MAA01153; Thu, 2 Nov 2006 12:00:48 -0800 X-Authentication-Warning: denzel.in: rtroy owned process doing -bs Date: Thu, 2 Nov 2006 12:00:48 -0800 (PST) From: Richard Troy X-X-Sender: To: AgentM cc: pgsql general Subject: Re: Is there anyway to... In-Reply-To: <26B58EAC-4BCC-470E-AC5E-477A5AA4CA52@themactionfaction.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/120 X-Sequence-Number: 103216 On Thu, 2 Nov 2006, AgentM wrote: > > > > Just some commentary... This is exactly the sort of thing cron is > > for. Duplicating that functionality in the RDBMS would be silly > > IMO. I don't see why you could consider cron to be "dirty" for > > this application... > > I actually tried to come up with something for this. There are plenty > of good reasons to have some timer functionality in the database: > > 1) it makes regular database-oriented tasks OS portable > 2) your cron user needs specific permissions + authorization to > access the database whereas postgres could handle "sudo"-like > behavior transparently > 3) there are triggers other than time that could be handy- on vacuum, > on db start, on db quit, on NOTIFY > > Unfortunately, the limitation I came across was for 2). There is no > way to use "set session authorization" or "set role" safely because > the wrapped code could always exit from the sandbox. So my timer only > works for db superusers. > > -M ...This type of need is exactly what custom written daemons are for. They're surely database and OS portable (or can be, at least), there's no need for any super-user capability of any kind, you can use any kind of trigger you like, and there's no permission leakage problem, either... I guess all you need is functioning nohup capability (which Windows systems may have trouble with, I don't know). Richard -- Richard Troy, Chief Scientist Science Tools Corporation 510-924-1363 or 202-747-1263 rtroy@ScienceTools.com, http://ScienceTools.com/