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 690DDD1B2A6 for ; Thu, 15 Jul 2004 14:19:42 -0300 (ADT) 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 65776-05 for ; Thu, 15 Jul 2004 17:19:41 +0000 (GMT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id D65A1D1B28B for ; Thu, 15 Jul 2004 14:19:39 -0300 (ADT) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Bl9tT-0004zx-00 for ; Thu, 15 Jul 2004 19:19:39 +0200 Received: from host-216-153-204-229.buf.choiceone.net ([216.153.204.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2004 19:19:39 +0200 Received: from jtk by host-216-153-204-229.buf.choiceone.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2004 19:19:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Jeff Kowalczyk Subject: 'UPDATE OR INSERT' command Date: Thu, 15 Jul 2004 13:20:57 -0500 Lines: 5 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: host-216-153-204-229.buf.choiceone.net User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=FORGED_YAHOO_RCVD X-Spam-Level: X-Archive-Number: 200407/94 X-Sequence-Number: 18346 Is there a postgresql SQL idiom to perform an UPDATE, which becomes an INSERT if the primary key does not exist? I'm not sure I *should* use it in my application, I just want to know if it can be done. Thanks.