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

Re: Open source databases '60 per cent cheaper'

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-advocacy(at)postgresql(dot)org
Subject: Re: Open source databases '60 per cent cheaper'
Date: 2006-11-27 18:00:44
Message-ID: 60ejroahwz.fsf@dba2.int.libertyrms.com (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-hackers
neilc(at)samurai(dot)com (Neil Conway) writes:
> On Mon, 2006-11-27 at 11:39 +0100, Markus Schaber wrote:
>> Hmm, I guess that the new RETURNING feature of PostgreSQL 8.2 can help
>> with this problem.
>
> I don't see how. The basic problem is that SQL is nondeterministic in
> general; you can't safely assume that evaluating the same sequence of
> SQL statements on all nodes will yield the same final database state.

Well, RETURNING means that there's some place which receives the
return set, which means that there is, in principle, a place where the
data would be capturable.

But it is important to point out that the "nondeterministic"
possibilities do not end with NOW() or CURRENT_TIMESTAMP; other
nondeterministic things that can cause trouble include:

 a) A sequence value, which is set *somewhat* invisibly,

 b) A query of the form
     insert into some_table (select * from a_table);
    where the SELECT subquery is not of the form:
        SELECT [fields] FROM [a_table] WHERE [Fully Deterministic Criterion]
           ORDER BY [some criterion suitable to be a primary key for the result set]
           LIMIT [anything];

If you could capture the RETURNING data, and replicate that, well,
that at least provides a way to get around the nondeterminism problem.
That would work out well for both INSERT and DELETE.  I'm not sure
it'll work as well for UPDATE; that doesn't return both old and new
column values :-(.
-- 
"cbbrowne","@","acm.org"
http://linuxdatabases.info/info/internet.html
"Problem  solving under linux  has never  been the  circus that  it is
under AIX."  -- Pete Ehlke in comp.unix.aix

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-11-27 18:02:50
Subject: Re: [CORE] RC1 blocker issues
Previous:From: Jim C. NasbyDate: 2006-11-27 17:54:33
Subject: Re: [CORE] RC1 blocker issues

pgsql-advocacy by date

Next:From: Jim NasbyDate: 2006-11-27 23:14:11
Subject: Re: Postgres Team: Thank You All
Previous:From: Andreas PflugDate: 2006-11-27 17:59:15
Subject: Re: Importand points about PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group