pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: duplicate key violates unique constraint
Date: Tue, 26 Feb 2008 11:22:46 -0500
Message-ID: <20080226162246.GA9865@crankycanuck.ca> (raw)
In-Reply-To: <016401c87891$58237950$3102a8c0@dream>
References: <014401c87887$a8fed450$3102a8c0@dream>
	<200802261617.39936.teemu@torma.org>
	<016401c87891$58237950$3102a8c0@dream>

On Tue, Feb 26, 2008 at 05:05:01PM +0100, Shavonne Marietta Wijesinghe wrote:
> Thank you. I tried as you said. But i get a ERROR:  syntax error at or near 
> "INSERT" at character 9
 
> I don't see anything wrong with the code..

Well, except that there's no "EXCEPTION" statement in SQL?  I think your
correspondent was intending for this to be programmatic.  You can do what
you want with a subtransaction, though.  Look into savepoints in the manual.

A




view thread (17+ messages)  latest in thread

Message-ID: <20080226162246.GA9865@crankycanuck.ca>
Permalink:  ../20080226162246.GA9865@crankycanuck.ca/
Also on:    postgresql.org/message-id/20080226162246.GA9865@crankycanuck.ca

 · 

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: ajs@crankycanuck.ca
  Subject: Re: duplicate key violates unique constraint
  In-Reply-To: <20080226162246.GA9865@crankycanuck.ca>

* 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