Re: Doc Patch: Subquery section to say that subqueries can't modify data - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Doc Patch: Subquery section to say that subqueries can't modify data
Date
Msg-id 525D5469.8000604@dalibo.com
Whole thread Raw
In response to Doc Patch: Subquery section to say that subqueries can't modify data  ("Karl O. Pinc" <kop@meme.com>)
List pgsql-hackers
On 08/06/2013 11:03 PM, Karl O. Pinc wrote:
> The attached documentation patch, doc-subqueries-v1.patch,
> applies against head.
>
> I wanted to document that subqueries can't modify data.
> This is mentioned in the documentation for SELECT and
> implied elsewhere but I was looking for something more
> than an 'in-passing' mention.
>
> (I wrote a bad query,
> modifying data in a subquery, couldn't recall where
> it was documented that you can't do this, and couldn't
> find the answer from the TOC or the index.  Now that
> there's lots of statements with RETURNING clauses
> it's natural to want to use them in subqueries.)

Hello, I am (finally) reviewing this patch.

After reading your reasoning, David's rebuttal, and the patch itself;
I'm wondering if this is needed or wanted at all.

Supposing it is wanted, it creates more questions than it answers.  The
two biggies are:

* In what other contexts can tabular subqueries be used?
* What are other ways of integrating data returned by data modification
statements?

On a superficial level I find the number of commas a bit clunky, and
"parentheses" is misspelled.

> The last 2 sentences of the first paragraph are
> something in the way of helpful hints and may not
> be appropriate, or even accurate.  I've left them in
> for review.

I think the last sentence (of the first paragraph) is a bit much, but
the penultimate seems fine.

I'm attaching an updated patch that I think is an improvement but it's
still at a draft level and needs more copyediting.  This new patch does
not attempt to answer the two questions above.

--
Vik


Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Patch for reserved connections for replication users
Next
From: Andres Freund
Date:
Subject: Re: logical changeset generation v6.2