Re: Writeable CTEs and side effects

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Writeable CTEs and side effects
Date: 2009-10-08 19:34:22
Message-ID: 1255030462.16369.119.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2009-10-08 at 15:11 -0400, Tom Lane wrote:
> > I'm not sure if this is a problem, but it seems like we're essentially
> > allowing a complex transaction to take place in one statement. Is that
> > what we want?
>
> Yeah, I think that's more or less the point ...

I'm still trying to ponder the consequences of this. Most people assume
that a single statement means that everything in the statement happens
at once (intuitively). The few cases where that's not true are special
commands or things that we are trying to fix, like:
"UPDATE foo SET a = a + 1".

I get the feeling that we're turning a declarative statement into
something more procedural.

I suppose one difference between this and a BEGIN ... END block would be
that the isolation from other transactions would always be SERIALIZABLE.

I can't clearly articulate a problem with any of these things, but it
does seem vaguely troubling.

Also, are we missing out on an opportunity to provide some interesting
functionality if we do treat two DML statements as happening
simultaneously? I've read some interesting perspectives on this in the
past, and it's not trivial, but we might want to leave the possibility
open.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-08 19:37:21 Re: Using results from INSERT ... RETURNING
Previous Message Tom Lane 2009-10-08 19:30:50 Re: Using results from INSERT ... RETURNING