X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 67E6D53DF0 for ; Tue, 15 Mar 2005 21:07:50 +0000 (GMT) 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 20078-10 for ; Tue, 15 Mar 2005 21:07:45 +0000 (GMT) Received: from grassmarket.ucs.ed.ac.uk (grassmarket.ucs.ed.ac.uk [129.215.166.64]) by svr1.postgresql.org (Postfix) with ESMTP id B7CC65692B for ; Tue, 15 Mar 2005 21:07:42 +0000 (GMT) Received: from grassmarket.ucs.ed.ac.uk (localhost [127.0.0.1]) by grassmarket.ucs.ed.ac.uk (8.12.10/8.12.10) with ESMTP id j2FL7hq0013050 for ; Tue, 15 Mar 2005 21:07:43 GMT Received: (from nobody@localhost) by grassmarket.ucs.ed.ac.uk (8.12.10/8.12.9/Submit) id j2FL7hLl013048 for pgsql-interfaces@postgresql.org; Tue, 15 Mar 2005 21:07:43 GMT From: SG Edwards X-Authentication-Warning: grassmarket.ucs.ed.ac.uk: nobody set sender to s0460205@sms.ed.ac.uk using -f Received: from usr1867-edi.blueyonder.co.uk (usr1867-edi.blueyonder.co.uk [62.31.103.90]) by sms.ed.ac.uk (IMP) with HTTP for ; Tue, 15 Mar 2005 21:07:43 +0000 Message-ID: <1110920863.42374e9f75aa1@sms.ed.ac.uk> Date: Tue, 15 Mar 2005 21:07:43 +0000 To: pgsql-interfaces@postgresql.org Subject: Check before insert MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.3 X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.516 tagged_above=0 required=5 tests=FROM_ENDS_IN_NUMS X-Spam-Level: X-Archive-Number: 200503/45 X-Sequence-Number: 5374 Hi, I have a table as follows: protein_id | name ___________ ______ P04667 Albumin P45366 Lactoglobulin .... etc I have a perl script that will insert data into this table from a file containing a list of protein_id and names. However, I only want to insert proteins where they are not already present in the database. Is there a way to do this using an SQL command? Thanks