pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fweimer@bfk.de>
To: pgsql@yukonho.de
Cc: pgsql-sql@postgresql.org
Subject: Re: Is there a solution for "SELECT OR INSERT"
Date: Tue, 30 Nov 2010 14:16:23 +0000
Message-ID: <82aakq99s8.fsf@mid.bfk.de> (raw)
In-Reply-To: <000001cb8f54$4a9e3c20$dfdab460$@de>
References: <000001cb8f54$4a9e3c20$dfdab460$@de>

* 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



view thread (2+ messages)

Message-ID: <82aakq99s8.fsf@mid.bfk.de>
Permalink:  ../82aakq99s8.fsf@mid.bfk.de/
Also on:    postgresql.org/message-id/82aakq99s8.fsf@mid.bfk.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fweimer@bfk.de, pgsql@yukonho.de
  Subject: Re: Is there a solution for "SELECT OR INSERT"
  In-Reply-To: <82aakq99s8.fsf@mid.bfk.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox