pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chine.bleu@yahoo.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6724: EXCEPTION syntax not recgonised
Date: Mon, 09 Jul 2012 17:19:40 +0000
Message-ID: <E1SoHca-0005qD-Qx@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      6724
Logged by:          Chine Bleu
Email address:      chine.bleu@yahoo.com
PostgreSQL version: 9.0.4
Operating system:   macosx
Description:        

query: BEGIN
INSERT INTO config (name, value) VALUES (E'dbexp', E'10');
EXCEPTION WHEN unique_violation THEN
UPDATE config SET value=E'10' WHERE name=E'dbexp';
END error: fatal query: ERROR:  syntax error at or near "INSERT"
LINE 2: INSERT INTO config (name, value) VALUES (E'dbexp', E'10');
        ^


query: BEGIN;
INSERT INTO config (name, value) VALUES (E'dbexp', E'10');
EXCEPTION WHEN unique_violation THEN
UPDATE config SET value=E'10' WHERE name=E'dbexp';
END error: fatal query: ERROR:  syntax error at or near "EXCEPTION"
LINE 3: EXCEPTION WHEN unique_violation THEN
        ^

This is so much easier than implementing that horror of REPLACE everyone
else has somehow figured out how to implement.

And, no, I don't really expect an answer. I will continue to use the
DELETE...;;INSERT... improvement on REPLACE.




view thread (2+ messages)  latest in thread

Message-ID: <E1SoHca-0005qD-Qx@wrigleys.postgresql.org>
Permalink:  ../E1SoHca-0005qD-Qx@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1SoHca-0005qD-Qx@wrigleys.postgresql.org

 · 

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 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-bugs@postgresql.org
  Cc: chine.bleu@yahoo.com
  Subject: Re: BUG #6724: EXCEPTION syntax not recgonised
  In-Reply-To: <E1SoHca-0005qD-Qx@wrigleys.postgresql.org>
  References: <E1SoHca-0005qD-Qx@wrigleys.postgresql.org>

* 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