X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B8B7332A0BB for ; Sun, 17 Oct 2004 01:49:33 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00637-06 for ; Sun, 17 Oct 2004 00:49:29 +0000 (GMT) Received: from hosting.commandprompt.com (128.commandprompt.com [207.173.200.128]) by svr1.postgresql.org (Postfix) with ESMTP id 28F1C32A0AF for ; Sun, 17 Oct 2004 01:49:31 +0100 (BST) Received: (from sklassen@localhost) by hosting.commandprompt.com (8.11.6/8.11.6) id i9H0nTk20173; Sat, 16 Oct 2004 17:49:29 -0700 Date: Sat, 16 Oct 2004 17:49:29 -0700 From: Steven Klassen To: "C. Bensend" Cc: pgsql-sql@postgresql.org Subject: Re: Inserting into table only if the row does not already Message-ID: <20041017004929.GB19149@commandprompt.com> References: <56362.63.227.74.41.1097813923.squirrel@63.227.74.41> <87hdow4ld1.fsf@stark.xeocode.com> <64883.63.227.74.41.1097846113.squirrel@63.227.74.41> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64883.63.227.74.41.1097846113.squirrel@63.227.74.41> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/101 X-Sequence-Number: 19204 * C. Bensend [2004-10-15 08:14:51 -0500]: > Concurrency shouldn't be an issue - this is a perl script running > from cron. The only concurrency that will ever happen is if I'm a > bonehead and I run the script manually right as cron kicks off > another copy. Even cron'd scripts can run amok. Lock files are great as a CYA measure even if you're relatively certain there will be no opportunity for one copy to step on the next. I once had a cron'd script mail upper management every hour I was on vacation. You can imagine how long it was until I got another vacation request approved. ;) -- Steven Klassen - Lead Programmer Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Replication & Support Services, (503) 667-4564