Skip site navigation (1) Skip section navigation (2)

Re: BUG #6724: EXCEPTION syntax not recgonised

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: chine(dot)bleu(at)yahoo(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6724: EXCEPTION syntax not recgonised
Date: 2012-07-10 04:02:16
Message-ID: CAFj8pRB0zMwEiNTN+YBtUep9nER3xQNwp9UQX4-9FgWCXvn0ig@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello

This is not bug

keyword EXCEPTION is supported only in plpgsql.

Regards

Pavel Stehule

2012/7/9  <chine(dot)bleu(at)yahoo(dot)com>:
> 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.
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2012-07-10 04:08:03
Subject: Re: BUG #6723: Exception for correct query
Previous:From: Maxim BogukDate: 2012-07-10 02:04:01
Subject: Re: BUG #6725: hot-standby slave repeatable crashed after restart (GIN error)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group