Re: Is there a solution for "SELECT OR INSERT" - Mailing list pgsql-sql

From Florian Weimer
Subject Re: Is there a solution for "SELECT OR INSERT"
Date
Msg-id 82aakq99s8.fsf@mid.bfk.de
Whole thread Raw
In response to Is there a solution for "SELECT OR INSERT"  ("Stefan Becker" <stefan@yukonho.de>)
List pgsql-sql
* Stefan Becker:

> Is there a way to get the ID row OR create a new one in
> ONE single statement?

You could create a stored procedure.  But if you have concurrent
inserts, locking is a bit tricky.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


pgsql-sql by date:

Previous
From: Carla
Date:
Subject: Re: subselect and left join not working?
Next
From: manidegr8
Date:
Subject: Re: Deleting entries from multiple tables