Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

rules.sgml

  • Tom Lane's avatar
    02f7b7ab
    Doc: fix ancient mistake, or at least obsolete info, in rules example. · 02f7b7ab
    Tom Lane authored
    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
    02f7b7ab
    History
    Doc: fix ancient mistake, or at least obsolete info, in rules example.
    Tom Lane authored
    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