Re: ask for review of MERGE

Bruce Momjian <bruce@momjian.us>

From: Bruce Momjian <bruce@momjian.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Robert Haas <robertmhaas@gmail.com>, Greg Smith <greg@2ndquadrant.com>, Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>, Boxuan Zhai <bxzhai2010@gmail.com>, Greg Stark <gsstark@mit.edu>, pgsql-hackers@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>, Martijn van Oosterhout <kleptog@svana.org>
Date: 2010-11-12T18:04:03Z
Lists: pgsql-hackers
Kevin Grittner wrote:
> Robert Haas <robertmhaas@gmail.com> wrote:
>  
> > rhaas=# create table concurrent (x integer primary key);
> > NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> > "concurrent_pkey" for table "concurrent"
> > CREATE TABLE
> > rhaas=# insert into x values (1);
> > rhaas=# begin;
> > BEGIN
> > rhaas=# insert into concurrent values (2);
> > INSERT 0 1
> > 
> > <switch to a different window>
> > 
> > rhaas=# update concurrent set x=x where x=2;
> > UPDATE 0
>  
> That surprised me.  I would have thought that the INSERT would have
> created an "in doubt" tuple which would block the UPDATE.  What is
> the reason for not doing so?

When Kevin gets surprised, I get worried.  LOL

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +