Re: [GENERAL] very basic SQL question

2010-11-23 Thread Dan Kortschak
Thanks for that - yes very helpful. Good to know what is possible. Dan On Tue, 2010-11-23 at 10:27 +0100, Matthieu Huin wrote: > A similar question was discussed here about 3 weeks ago : > http://archives.postgresql.org/pgsql-general/2010-11/msg00110.php > > The "UPSERT" facility not being impl

Re: [GENERAL] very basic SQL question

2010-11-23 Thread Matthieu Huin
A similar question was discussed here about 3 weeks ago : http://archives.postgresql.org/pgsql-general/2010-11/msg00110.php The "UPSERT" facility not being implemented yet, I don't think it is possible to do much better than what you came up with. Assuming the column(s) holding the distinctiv

Re: [GENERAL] very basic SQL question

2010-11-23 Thread Sam Mason
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

[GENERAL] very basic SQL question

2010-11-22 Thread Dan Kortschak
Hi, I'm using Pg for bioinformatic work and 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. At the moment it seems to me that I should do a SELECT