pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
INSERT OR UPDATE WITHOUT SELECT
2+ messages / 2 participants
[nested] [flat]

* INSERT OR UPDATE WITHOUT SELECT
@ 2006-05-30 20:47 wmiro@ig.com.br <wmiro@ig.com.br>
  2006-06-04 07:40 ` Re: INSERT OR UPDATE WITHOUT SELECT A. Kretschmer <andreas.kretschmer@schollglas.com>
  0 siblings, 1 reply; 2+ messages in thread

From: wmiro@ig.com.br @ 2006-05-30 20:47 UTC (permalink / raw)
  To: 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. 





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: INSERT OR UPDATE WITHOUT SELECT
  2006-05-30 20:47 INSERT OR UPDATE WITHOUT SELECT wmiro@ig.com.br <wmiro@ig.com.br>
@ 2006-06-04 07:40 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
  0 siblings, 0 replies; 2+ messages in thread

From: A. Kretschmer @ 2006-06-04 07:40 UTC (permalink / raw)
  To: pgsql-performance

am  30.05.2006, um 17:47:47 -0300 mailte wmiro@ig.com.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    === 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-06-04 07:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-30 20:47 INSERT OR UPDATE WITHOUT SELECT wmiro@ig.com.br <wmiro@ig.com.br>
2006-06-04 07:40 ` A. Kretschmer <andreas.kretschmer@schollglas.com>

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