pgsql: Doc: fix ancient mistake, or at least obsolete info, in rules ex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Doc: fix ancient mistake, or at least obsolete info, in rules ex
Date: 2019-11-11 19:40:15
Message-ID: E1iUFXr-0007K7-KP@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b6423e92abfadaa1ed9642319872aa1654403cd6

Modified Files
--------------
doc/src/sgml/rules.sgml | 32 ++++++++------------------------
1 file changed, 8 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-11-11 22:03:53 pgsql: Stamp 12.1.
Previous Message Tom Lane 2019-11-11 15:33:10 pgsql: Further improve stability of partition_prune regression test.