Re: Writeable CTEs and side effects - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Writeable CTEs and side effects
Date
Msg-id 1255030462.16369.119.camel@monkey-cat.sm.truviso.com
Whole thread Raw
In response to Re: Writeable CTEs and side effects  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Writeable CTEs and side effects
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using results from INSERT ... RETURNING
Next
From: Robert Haas
Date:
Subject: Re: Using results from INSERT ... RETURNING