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

From Karl O. Pinc
Subject Doc Patch: Subquery section to say that subqueries can't modify data
Date
Msg-id 1375822993.31841.1@slate
Whole thread Raw
Responses Re: Doc Patch: Subquery section to say that subqueries can't modify data  (David Johnston <polobo@yahoo.com>)
Re: Doc Patch: Subquery section to say that subqueries can't modify data  (Vik Fearing <vik.fearing@dalibo.com>)
List pgsql-hackers
Hi,

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.)

There seemed to be no good place to put this in the
tutorial section of the documentation.  I wound
up adding a small, 2 paragraph, section describing subqueries to
the chapter on queries.  Although the first paragraph
echos what's already documented the utility of
subqueries is such that it's nice to have a
place in the tutorial that serves as a single point of
reference.

The alternative seemed to be to put the 2nd paragraph
in "9.22. Subquery Expressions", and this didn't seem
to fit well.

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.

Regards,

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: DATE type output does not follow datestyle parameter
Next
From: Greg Stark
Date:
Subject: Re: Review: UNNEST (and other functions) WITH ORDINALITY