check row before insert

From: SG Edwards <s0460205(at)sms(dot)ed(dot)ac(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: check row before insert
Date: 2005-03-15 12:48:57
Message-ID: 1110890937.4236d9b950ba0@sms.ed.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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 preset in the database. Is there a way to
do this using an SQL command?

Thanks

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-15 13:55:26 Re: check row before insert
Previous Message Chris Winfield-Blum 2005-03-15 02:59:04 Postgre and attachments