Lists: | pgsql-performance |
---|
From: | wmiro(at)ig(dot)com(dot)br <wmiro(at)ig(dot)com(dot)br> |
---|---|
To: | pgsql-performance(at)postgresql(dot)org |
Subject: | INSERT OR UPDATE WITHOUT SELECT |
Date: | 2006-05-30 20:47:47 |
Message-ID: | 20060530_204747_020181.wmiro@ig.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-performance |
Hi,
Is there a command to Insert a record If It does not exists and a update if
It exists?
I do not want to do a select before a insert or update.
I mean the postgres should test if a record exist before insert and if It
exist then the postgres must do an update instead an insert.
Thanks,
WMiro.
From: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
---|---|
To: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: INSERT OR UPDATE WITHOUT SELECT |
Date: | 2006-06-04 07:40:14 |
Message-ID: | 20060604074014.GA2447@webserv.wug-glas.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-performance |
am 30.05.2006, um 17:47:47 -0300 mailte wmiro(at)ig(dot)com(dot)br folgendes:
> Hi,
>
> Is there a command to Insert a record If It does not exists and a update if
> It exists?
Not a single command, but a solution:
http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47215, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===