Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #374

Re: Damned postgres crap.

From Lennart Jonsson <erik.lennart.jonsson@gmail.com>
Newsgroups comp.databases.postgresql
Subject Re: Damned postgres crap.
Date 2012-07-09 21:42 +0200
Organization A noiseless patient Spider
Message-ID <jtfc7l$b9i$1@dont-email.me> (permalink)
References <chine.bleu-AE3031.10123209072012@news.eternal-september.org>

Show all headers | View raw


On 2012-07-09 19:12, China Blue [Tor], Meersburg wrote:
> 10:06:21.08586.03.0001.  query: BEGIN
>         .08586.03.0001.INSERT INTO config (name, value) VALUES (E'dbexp', E'10');
>         .08586.03.0001.EXCEPTION WHEN unique_violation THEN
>         .08586.03.0001.UPDATE config SET value=E'10' WHERE name=E'dbexp';
>         .08586.03.0001.END error: fatal query: ERROR:  syntax error at or near 
> "INSERT"
>         .08586.03.0001.LINE 2: INSERT INTO config (name, value) VALUES 
> (E'dbexp', E'10');
>         .08586.03.0001.        ^
> 
> 
> 10:10:01.09104.03.0001.  query: BEGIN;
>         .09104.03.0001.INSERT INTO config (name, value) VALUES (E'dbexp', E'10');
>         .09104.03.0001.EXCEPTION WHEN unique_violation THEN
>         .09104.03.0001.UPDATE config SET value=E'10' WHERE name=E'dbexp';
>         .09104.03.0001.END error: fatal query: ERROR:  syntax error at or near 
> "EXCEPTION"
>         .09104.03.0001.LINE 3: EXCEPTION WHEN unique_violation THEN
>         .09104.03.0001.        ^
> 
> 
> At least Postgres retains its ideological purity by avoiding that terrible 
> REPLACE command everyone else uses.
> 

Everyone else who? You might want to have a look at the MERGE statement
which where introduced in SQL2003 and is supported by at least
PostgreSQL, Oracle, DB2 and SQL server.

/Lennart

Back to comp.databases.postgresql | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Damned postgres crap. "China Blue [Tor], Meersburg" <chine.bleu@yahoo.com> - 2012-07-09 10:12 -0700
  Re: Damned postgres crap. Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2012-07-09 21:42 +0200
    Re: PostgreSQL missing features (was rant about PostgreSQL) Hans Castorp <REWYRLXHEGHO@spammotel.com> - 2012-07-09 21:58 +0200
      Re: PostgreSQL missing features (was rant about PostgreSQL) Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2012-07-09 22:34 +0200
    Re: Damned postgres crap. "China Blue [Tor], Meersburg" <chine.bleu@yahoo.com> - 2012-07-09 13:45 -0700
      Re: Damned postgres crap. Matthew Woodcraft <mattheww@chiark.greenend.org.uk> - 2012-07-09 22:14 +0100
        Re: Damned postgres crap. "China Blue [Tor], Meersburg" <chine.bleu@yahoo.com> - 2012-07-09 21:03 -0700
          Re: Damned postgres crap. Matthew Woodcraft <mattheww@chiark.greenend.org.uk> - 2012-07-10 14:55 +0100

csiph-web