BUG #6724: EXCEPTION syntax not recgonised

From: chine(dot)bleu(at)yahoo(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6724: EXCEPTION syntax not recgonised
Date: 2012-07-09 17:19:40
Message-ID: E1SoHca-0005qD-Qx@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6724
Logged by: Chine Bleu
Email address: chine(dot)bleu(at)yahoo(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message maxim.boguk 2012-07-09 23:54:54 BUG #6725: hot-standby slave repeatable crashed after restart (GIN error)
Previous Message Dave Page 2012-07-09 13:12:01 Re: BUG #6722: Debugger broken?