From: Rob Anderson <roba@bml.uk.com>
To: pgsql-admin@postgresql.org
Subject: Testing for existence of a record before insert
Date: Tue, 23 Mar 2004 16:41:40 -0000
Message-ID: <FHEPJNONMOLHMPDJDOCMOEPHFGAA.roba@bml.uk.com> (raw)
I am trying to find a way of performing something similar to the SQL-Server SQL of
IF NOT EXISTS (SELECT id FROM a_table WHERE id='akey')
THEN INSERT INTO a_table (id, name) values ('akey', 'adetails');
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.619 / Virus Database: 398 - Release Date: 10/03/2004
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: roba@bml.uk.com
Subject: Re: Testing for existence of a record before insert
In-Reply-To: <FHEPJNONMOLHMPDJDOCMOEPHFGAA.roba@bml.uk.com>
References: <FHEPJNONMOLHMPDJDOCMOEPHFGAA.roba@bml.uk.com>
* 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