Re: wCTE: about the name of the feature

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: wCTE: about the name of the feature
Date: 2011-02-24 16:20:48
Message-ID: 12023.1298564448@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The wCTE patch refers to the feature it's adding as "DML WITH". I'm
still pretty unhappy with that terminology. In my view of the world,
"DML" includes SELECT as well as INSERT/UPDATE/DELETE. The wikipedia
entry about the term
http://en.wikipedia.org/wiki/Data_Manipulation_Language
agrees that that's at least the majority usage, and even our own docs
seem to use it to include SELECT as often as not. Since the distinction
is absolutely critical to talking about this feature sensibly, I don't
think it's a good plan to use an acronym that is guaranteed to produce
uncertainty in the reader's mind.

The best idea I have at the moment is to spell out "data modifying
command" (or "statement") rather than relying on the acronym.
In the code, we could change hasDmlWith to hasModifyingWith, for
example. The error messages could read like
data-modifying statement in WITH is not allowed in a view

Comments?

regards, tom lane


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 16:33:08
Message-ID: 4D668844.5050907@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-24 6:20 PM +0200, Tom Lane wrote:
> The wCTE patch refers to the feature it's adding as "DML WITH". I'm
> still pretty unhappy with that terminology. In my view of the world,
> "DML" includes SELECT as well as INSERT/UPDATE/DELETE. The wikipedia
> entry about the term
> http://en.wikipedia.org/wiki/Data_Manipulation_Language
> agrees that that's at least the majority usage, and even our own docs
> seem to use it to include SELECT as often as not. Since the distinction
> is absolutely critical to talking about this feature sensibly, I don't
> think it's a good plan to use an acronym that is guaranteed to produce
> uncertainty in the reader's mind.

Agreed.

> The best idea I have at the moment is to spell out "data modifying
> command" (or "statement") rather than relying on the acronym.
> In the code, we could change hasDmlWith to hasModifyingWith, for
> example. The error messages could read like
> data-modifying statement in WITH is not allowed in a view
>
> Comments?

Out of everything suggested so far, I think this is the best we have, if
we can fit the whole thing into out error messages. Quickly grepping
through the patch suggests that we can, at least for the cases in the
current patch.

I also prefer "statement" over "command".

Regards,
Marko Tiikkaja


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 16:37:38
Message-ID: 12432.1298565458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2011-02-24 6:20 PM +0200, Tom Lane wrote:
>> The best idea I have at the moment is to spell out "data modifying
>> command" (or "statement") rather than relying on the acronym.
>> In the code, we could change hasDmlWith to hasModifyingWith, for
>> example. The error messages could read like
>> data-modifying statement in WITH is not allowed in a view
>>
>> Comments?

> Out of everything suggested so far, I think this is the best we have, if
> we can fit the whole thing into out error messages. Quickly grepping
> through the patch suggests that we can, at least for the cases in the
> current patch.

> I also prefer "statement" over "command".

OK, I will make those adjustments. Are you going to do more work on the
documentation part of the patch? I can stick to working on the code
part meanwhile, if you are.

regards, tom lane


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 16:40:58
Message-ID: 4D668A1A.1040104@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-24 6:37 PM +0200, Tom Lane wrote:
> OK, I will make those adjustments. Are you going to do more work on the
> documentation part of the patch? I can stick to working on the code
> part meanwhile, if you are.

I am planning on working on the documentation this weekend.

Regards,
Marko Tiikkaja


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 16:40:59
Message-ID: 4D668A1B.4090201@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 02/24/2011 11:20 AM, Tom Lane wrote:
> The wCTE patch refers to the feature it's adding as "DML WITH". I'm
> still pretty unhappy with that terminology. In my view of the world,
> "DML" includes SELECT as well as INSERT/UPDATE/DELETE. The wikipedia
> entry about the term
> http://en.wikipedia.org/wiki/Data_Manipulation_Language
> agrees that that's at least the majority usage, and even our own docs
> seem to use it to include SELECT as often as not. Since the distinction
> is absolutely critical to talking about this feature sensibly, I don't
> think it's a good plan to use an acronym that is guaranteed to produce
> uncertainty in the reader's mind.
>
> The best idea I have at the moment is to spell out "data modifying
> command" (or "statement") rather than relying on the acronym.
> In the code, we could change hasDmlWith to hasModifyingWith, for
> example. The error messages could read like
> data-modifying statement in WITH is not allowed in a view
>
> Comments?
>

I think your're absolutely right. DML means that to me too. It's in
effect the opposite of DDL.

log_statement used "mod" for this category of statements. If we need a
new acronym, I modestly suggest "CUD" (CRUD without the R). The we could
make all sorts of puns about "chewing the CUD" :-)

cheers

andrew


From: Robert Haas <robertmhaas(at)gmail(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>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 18:43:13
Message-ID: AANLkTinmeuRUXJ21c9+DRz918kXba3GA8O0DVd4R+vVq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 24, 2011 at 11:20 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The wCTE patch refers to the feature it's adding as "DML WITH".  I'm
> still pretty unhappy with that terminology.  In my view of the world,
> "DML" includes SELECT as well as INSERT/UPDATE/DELETE.  The wikipedia
> entry about the term
> http://en.wikipedia.org/wiki/Data_Manipulation_Language
> agrees that that's at least the majority usage, and even our own docs
> seem to use it to include SELECT as often as not.  Since the distinction
> is absolutely critical to talking about this feature sensibly, I don't
> think it's a good plan to use an acronym that is guaranteed to produce
> uncertainty in the reader's mind.
>
> The best idea I have at the moment is to spell out "data modifying
> command" (or "statement") rather than relying on the acronym.
> In the code, we could change hasDmlWith to hasModifyingWith, for
> example.  The error messages could read like
>        data-modifying statement in WITH is not allowed in a view
>
> Comments?

Great idea. I had the same complaint when I looked at this patch a
year ago, but didn't come up with nearly as good an idea as to what to
do about it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-24 19:35:30
Message-ID: A1D51E5C-8637-4056-B146-06214B054189@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Feb 24, 2011, at 10:43 AM, Robert Haas wrote:

>> The best idea I have at the moment is to spell out "data modifying
>> command" (or "statement") rather than relying on the acronym.
>> In the code, we could change hasDmlWith to hasModifyingWith, for
>> example. The error messages could read like
>> data-modifying statement in WITH is not allowed in a view
>>
>> Comments?
>
> Great idea. I had the same complaint when I looked at this patch a
> year ago, but didn't come up with nearly as good an idea as to what to
> do about it.

I like "statement" better than "command," too, but love the acronym DMC. As in, "you want to Run [a] DMC." ;-P

David


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 00:00:11
Message-ID: 13511.1298678411@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2011-02-24 6:37 PM +0200, Tom Lane wrote:
>> OK, I will make those adjustments. Are you going to do more work on the
>> documentation part of the patch? I can stick to working on the code
>> part meanwhile, if you are.

> I am planning on working on the documentation this weekend.

I've gone ahead and applied the code portion of the patch, with
modifications as per discussion, and other editorialization.
I'll wait on you to produce documentation updates before dealing
with the docs, but I figured we might as well get some buildfarm
cycles on it meanwhile.

regards, tom lane


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 02:19:41
Message-ID: 4D68633D.4090604@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-26 2:00 AM, Tom Lane wrote:
> I've gone ahead and applied the code portion of the patch, with
> modifications as per discussion, and other editorialization.

Thanks a lot!

One thing bothers me though: what was the reason for requiring a
RETURNING clause for data-modifying statements in WITH?

> I'll wait on you to produce documentation updates before dealing
> with the docs, but I figured we might as well get some buildfarm
> cycles on it meanwhile.

Thanks, I'll send an improved version tomorrow.

Regards,
Marko Tiikkaja


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 02:41:20
Message-ID: 2113.1298688080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2011-02-26 2:00 AM, Tom Lane wrote:
>> I've gone ahead and applied the code portion of the patch, with
>> modifications as per discussion, and other editorialization.

> Thanks a lot!

> One thing bothers me though: what was the reason for requiring a
> RETURNING clause for data-modifying statements in WITH?

That test was in your patch, no? I moved the code to another place
but it's still enforcing the same thing, namely that you can't reference
the output of an INSERT/UPDATE/DELETE that hasn't got RETURNING.

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 02:49:03
Message-ID: 20110226024903.GB27388@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 24, 2011 at 11:20:48AM -0500, Tom Lane wrote:
> The wCTE patch refers to the feature it's adding as "DML WITH". I'm
> still pretty unhappy with that terminology. In my view of the world,
> "DML" includes SELECT as well as INSERT/UPDATE/DELETE. The wikipedia
> entry about the term
> http://en.wikipedia.org/wiki/Data_Manipulation_Language
> agrees that that's at least the majority usage, and even our own docs
> seem to use it to include SELECT as often as not. Since the distinction
> is absolutely critical to talking about this feature sensibly, I don't
> think it's a good plan to use an acronym that is guaranteed to produce
> uncertainty in the reader's mind.
>
> The best idea I have at the moment is to spell out "data modifying
> command" (or "statement") rather than relying on the acronym.
> In the code, we could change hasDmlWith to hasModifyingWith, for
> example. The error messages could read like
> data-modifying statement in WITH is not allowed in a view
>
> Comments?

+1

If we ever decide add in what I'd originally envisioned, namely DCL
and DDL, the name continues to describe what's going on :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: David Fetter <david(at)fetter(dot)org>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 02:50:27
Message-ID: 20110226025027.GC27388@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Feb 24, 2011 at 11:35:30AM -0800, David Wheeler wrote:
> On Feb 24, 2011, at 10:43 AM, Robert Haas wrote:
>
> >> The best idea I have at the moment is to spell out "data modifying
> >> command" (or "statement") rather than relying on the acronym.
> >> In the code, we could change hasDmlWith to hasModifyingWith, for
> >> example. The error messages could read like
> >> data-modifying statement in WITH is not allowed in a view
> >>
> >> Comments?
> >
> > Great idea. I had the same complaint when I looked at this patch
> > a year ago, but didn't come up with nearly as good an idea as to
> > what to do about it.
>
> I like "statement" better than "command," too, but love the acronym
> DMC. As in, "you want to Run [a] DMC." ;-P

Hit it, Run! ;)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Robert Haas <robertmhaas(at)gmail(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>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 05:20:10
Message-ID: AANLkTi=gFURj9bFF9bCtUqSDNU5EPY4ECX91v3VKJ+-Y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Feb 25, 2011 at 7:00 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
>> On 2011-02-24 6:37 PM +0200, Tom Lane wrote:
>>> OK, I will make those adjustments.  Are you going to do more work on the
>>> documentation part of the patch?  I can stick to working on the code
>>> part meanwhile, if you are.
>
>> I am planning on working on the documentation this weekend.
>
> I've gone ahead and applied the code portion of the patch,

Yay! I'm excited about this, particularly the possible "pipelining"
stuff, where you can do WITH (DELETE .. RETURNING ..) INSERT ... and
have it be like cool and fast and stuff.

Or at least I hope you can do that.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 05:30:25
Message-ID: 7653.1298698225@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Yay! I'm excited about this, particularly the possible "pipelining"
> stuff, where you can do WITH (DELETE .. RETURNING ..) INSERT ... and
> have it be like cool and fast and stuff.

> Or at least I hope you can do that.

It's gonna need some work yet. As things stand, the tuples are indeed
pipelined through, but the CteScan nodes *also* stash them aside into
tuplestores, just in case somebody demands a rescan. Fixing that will
require revisiting the exec flags (EXEC_FLAG_REWIND etc). We don't
currently distinguish "it's unlikely you'll have to rescan" from
"you're guaranteed not to have to rescan", but a CteScan that's covering
a ModifyTable has to know the latter to not have to keep hold of copies
of the RETURNING tuples.

It might be a small enough change to do after alpha starts, but I don't
have time for it right now.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(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>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 05:52:40
Message-ID: AANLkTikDpRzKGvcAJ+L4wZOZtcE4OJ3pSZztcS4Mjuzz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Feb 26, 2011 at 12:30 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Yay!  I'm excited about this, particularly the possible "pipelining"
>> stuff, where you can do WITH (DELETE .. RETURNING ..) INSERT ...  and
>> have it be like cool and fast and stuff.
>
>> Or at least I hope you can do that.
>
> It's gonna need some work yet.  As things stand, the tuples are indeed
> pipelined through, but the CteScan nodes *also* stash them aside into
> tuplestores, just in case somebody demands a rescan.  Fixing that will
> require revisiting the exec flags (EXEC_FLAG_REWIND etc).  We don't
> currently distinguish "it's unlikely you'll have to rescan" from
> "you're guaranteed not to have to rescan", but a CteScan that's covering
> a ModifyTable has to know the latter to not have to keep hold of copies
> of the RETURNING tuples.
>
> It might be a small enough change to do after alpha starts, but I don't
> have time for it right now.

Well, if nothing else, the potential is there for a future release.
I'm probably not quite as excited about this feature as David Fetter
(and my 100-Watt lightbulb is not quite as bright as the sun at high
noon in midsummer) but I do think it's pretty cool, and I appreciate
you getting it in, even in a somewhat basic form.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 10:48:38
Message-ID: 4D68DA86.7020403@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-26 4:41 AM +0200, Tom Lane wrote:
> Marko Tiikkaja<marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
>> One thing bothers me though: what was the reason for requiring a
>> RETURNING clause for data-modifying statements in WITH?
>
> That test was in your patch, no? I moved the code to another place
> but it's still enforcing the same thing, namely that you can't reference
> the output of an INSERT/UPDATE/DELETE that hasn't got RETURNING.

Oh, right. I misunderstood.

Regards,
Marko Tiikkaja


From: David Fetter <david(at)fetter(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-26 22:49:44
Message-ID: 20110226224944.GA19510@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Feb 26, 2011 at 12:52:40AM -0500, Robert Haas wrote:
> On Sat, Feb 26, 2011 at 12:30 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> >> Yay!  I'm excited about this, particularly the possible "pipelining"
> >> stuff, where you can do WITH (DELETE .. RETURNING ..) INSERT ...  and
> >> have it be like cool and fast and stuff.
> >
> >> Or at least I hope you can do that.
> >
> > It's gonna need some work yet.  As things stand, the tuples are indeed
> > pipelined through, but the CteScan nodes *also* stash them aside into
> > tuplestores, just in case somebody demands a rescan.  Fixing that will
> > require revisiting the exec flags (EXEC_FLAG_REWIND etc).  We don't
> > currently distinguish "it's unlikely you'll have to rescan" from
> > "you're guaranteed not to have to rescan", but a CteScan that's covering
> > a ModifyTable has to know the latter to not have to keep hold of copies
> > of the RETURNING tuples.
> >
> > It might be a small enough change to do after alpha starts, but I don't
> > have time for it right now.
>
> Well, if nothing else, the potential is there for a future release.

That's kinda where I am on this one. In the grand PostgreSQL
tradition, we can have something that works before we have something
that works fast :)

> I'm probably not quite as excited about this feature as David Fetter

Heh!

> (and my 100-Watt lightbulb is not quite as bright as the sun at high
> noon in midsummer) but I do think it's pretty cool, and I appreciate
> you getting it in, even in a somewhat basic form.

Me, too!

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-27 17:14:41
Message-ID: 4D6A8681.3080000@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-24 6:40 PM, I wrote:
> I am planning on working on the documentation this weekend.

And here's my attempt. The language is a bit poor at some places but I
can't think of anything better.

I tried to be more strict about using "subquery" when talking about
WITHs in general since INSERT/UPDATE/DELETE is not a subquery in my book.

Regards,
Marko Tiikkaja

Attachment Content-Type Size
dmswithdoc1.patch text/plain 12.4 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-27 18:56:26
Message-ID: 19367.1298832986@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2011-02-24 6:40 PM, I wrote:
>> I am planning on working on the documentation this weekend.

> And here's my attempt. The language is a bit poor at some places but I
> can't think of anything better.

Thanks, will work on this next.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-28 06:20:32
Message-ID: 15829.1298874032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
> On 2011-02-24 6:40 PM, I wrote:
>> I am planning on working on the documentation this weekend.

> And here's my attempt. The language is a bit poor at some places but I
> can't think of anything better.

Applied after some rather heavy editorialization.

> I tried to be more strict about using "subquery" when talking about
> WITHs in general since INSERT/UPDATE/DELETE is not a subquery in my book.

I undid most of those changes --- it didn't seem to add anything to be
strict in this way, and anyway you hadn't done it consistently,
eg the syntax still had "with_query".

regards, tom lane


From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: wCTE: about the name of the feature
Date: 2011-02-28 10:13:16
Message-ID: 4D6B753C.1010502@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2011-02-28 8:20 AM +0200, Tom Lane wrote:
> Marko Tiikkaja<marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi> writes:
>> On 2011-02-24 6:40 PM, I wrote:
>>> I am planning on working on the documentation this weekend.
>
>> And here's my attempt. The language is a bit poor at some places but I
>> can't think of anything better.
>
> Applied after some rather heavy editorialization.

Thanks again.

>> I tried to be more strict about using "subquery" when talking about
>> WITHs in general since INSERT/UPDATE/DELETE is not a subquery in my book.
>
> I undid most of those changes --- it didn't seem to add anything to be
> strict in this way, and anyway you hadn't done it consistently,
> eg the syntax still had "with_query".

I wasn't so sure about those changes either. It does seem more
consistent this way.

Regards,
Marko Tiikkaja