Re: INSERT OU UPDATE WITHOUT SELECT?

From: PFC <lists(at)peufeu(dot)com>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Waldomiro <waldomiro(at)shx(dot)com(dot)br>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: INSERT OU UPDATE WITHOUT SELECT?
Date: 2006-05-30 22:35:15
Message-ID: op.tadyc1jwcigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> PostgreSQL does not support MERGE at the moment, sorry.

Issue an UPDATE, and watch the rowcount ; if the rowcount is 0, issue an
INSERT.
Be prepared to retry if another transaction has inserted the row
meanwhile, though.

MERGE would be really useful.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message PFC 2006-05-30 22:37:03 Re: Optimizing a huge_table/tiny_table join
Previous Message Daniel J. Luke 2006-05-30 22:03:11 Re: Getting even more insert performance (250m+rows/day)