Re: very basic SQL question

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: very basic SQL question
Date: 2010-11-23 12:34:58
Message-ID: 20101123123458.GH6225@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 23, 2010 at 02:09:19PM +1030, Dan Kortschak wrote:
> I want to be able to insert,
> uniquely, biological sequences into a table returning the sequence id -
> this part is fine. However, if the sequence already exists in the table
> I want to return to id.

The term you're looking for is "UPSERT", the following looks relevant:

http://stackoverflow.com/questions/1109061/insert-on-duplicate-update-postgresql

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-11-23 14:16:19 Re: Connection pool
Previous Message Robert Gravsjö 2010-11-23 12:00:07 Re: Debug advice when postgres connection maxing out