

PostgreSQL 9.1.2 - deedee
http://www.postgresql.org/docs/9.1/static/release-9-1-2.html

======
FooBarWidget
Does anybody know whether PostgreSQL is going to implement UPSERT or MERGE
support any time soon? I hate having to lock tables to emulate this.

~~~
saurik
It is not actually certain whether a standards-compliant implementation of
MERGE would actually solve the UPSERT case (there have been some interesting
mailing list discussions related to this, as that seemed to be an incorrect
yet long-standing assumption of some people defining the roadmap).

Regardless, you don't need a table lock to do it in any case. Doing so without
such a lock is actually an example from the documentation:

[http://www.postgresql.org/docs/current/static/plpgsql-
contro...](http://www.postgresql.org/docs/current/static/plpgsql-control-
structures.html#PLPGSQL-UPSERT-EXAMPLE)

In essence, you just do the UPDATE, and if you ge back no affected rows, you
perform an INSERT. If the INSERT fails because the row already exists, you do
the UPDATE again.

------
gjm11
Postgres is wonderful and important, but consider before upvoting: What would
HN look like if every x.y.z release of every wonderful and important piece of
software landed on the front page?

~~~
DrJokepu
I actually like it. Threads for new version releases like that are good for
discussing new features, there's often someone who is very familiar with the
product and the problem domain who explains the relevant issues for the rest
of us, sometimes there are interesting debates about the general problems and
the future of the particular product and its competitors. These threads are
often very interesting and informative and in my opinion they are much more
valuable and educating than another thread denouncing patents and copyright as
the ultimate evil or accusing something or someone of censorship or something
like that.

~~~
dguaraglia
Agreed, although I'd hate HN to become a stream of minor version updates.
Postgres is a bit different in that every 'minor' release actually contains a
bunch of important changes.

Anyway, off to see if I can find the newest and greatest version for Ubuntu.

