]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Doc: fix ancient mistake, or at least obsolete info, in rules example.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Nov 2019 19:39:54 +0000 (14:39 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Nov 2019 19:39:54 +0000 (14:39 -0500)
commitb3c762a45a14e119acf371f60eb01c8d3607f714
treeb986159100343b2bc25e8afb87d1a75161659b12
parente72b6c39f0fb455b48632afa0c6e3bed9ecf941e
Doc: fix ancient mistake, or at least obsolete info, in rules example.

The example of expansion of multiple views claimed that the resulting
subquery nest would not get fully flattened because of an aggregate
function.  There's no aggregate in the example, though, only a user
defined function confusingly named MIN().  In a modern server, the
reason for the non-flattening is that MIN() is volatile, but I'm
unsure whether that was true back when this text was written.

Let's reduce the confusion level by using LEAST() instead (which
we didn't have at the time this example was created).  And then
we can just say that the planner will flatten the sub-queries, so
the rewrite system doesn't have to.

Noted by Paul Jungwirth.  This text is old enough to vote, so
back-patch to all supported branches.

Discussion: https://postgr.es/m/CA+renyXZFnmp9PcvX1EVR2dR=XG5e6E-AELr8AHCNZ8RYrpnPw@mail.gmail.com
doc/src/sgml/rules.sgml