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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: INSERT OU UPDATE WITHOUT SELECT?



PFC wrote:
> >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.

Oh, you mean, like the example that's in the documentation?

http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

Example 36-1

> 	MERGE would be really useful.

It has been discussed before -- MERGE is something different.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group