Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvVVF-0006uh-SU for pgsql-bugs@arkaria.postgresql.org; Mon, 30 May 2022 02:51:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvVVE-0002hP-Ic for pgsql-bugs@arkaria.postgresql.org; Mon, 30 May 2022 02:51:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvVVE-0002hF-8n for pgsql-bugs@lists.postgresql.org; Mon, 30 May 2022 02:51:32 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nvVVC-0008Gr-5X for pgsql-bugs@lists.postgresql.org; Mon, 30 May 2022 02:51:31 +0000 Received: by mail-oi1-x22c.google.com with SMTP id l84so12528869oif.10 for ; Sun, 29 May 2022 19:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yxMJuolYCpv6bT7+xqaQnkmwYVmZvNE5wtKRCvU58LQ=; b=NB36w1SSauv5FGJqrZ3f7ue7gRs9muvDEt/6MxplpXOBD+yA0Fa7v44OIFpt6JmYlC TXJCEaIC1tBoj54DVYb7dsCH2dr2nNJ1/5QpLevo9H3vdmSHfTMwZ5lpcdJw2PBbG1aI p37zi2LeYQ55bR4m69CoS2f0B+Wo2hUa9jWfQUuJStby9p71ZEZAc/syFXBHjcYHRZY2 7ua8rPNVPESM8Q/vdL3wMZuuDEvH0/YBXbZXqumakdfyXIBiz4Bsv38jp1/fv+z9jwOJ a+T5DbH5uVT0Hz9bWtNWCv+aGzKKje92AT6olL0jqekNc1XZG1VIxtBS3fDiW9wPRxa0 fDUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yxMJuolYCpv6bT7+xqaQnkmwYVmZvNE5wtKRCvU58LQ=; b=TXVMB7T/HkM6hN+h0AtvDJ9LkE/uPdtnjVm2zjliIooDVzeJVfX5Sgxz4TrjKzk+qs q/IwKmm+crDVj3dc6LVE0ZrpSe9uPjFjn8MwJIdsqbyMsBqGVyTeY5l9ui4gfnGFqe9V QirDQIWemBd/ar8j5e+fKuLAQyoR7tMsCgb35fesWTq54FyPVl84yNmgwxf91WMkWmWo 0wXrRZuFhjrVp8Ir0cLuocDgOXv5ES6OR9VlO9fkCNHDqQ65FHTwDnEGHglQE8+rqgIx p0eYJzB//+FO1iTAuRrjnBovU5X7zHma5PE4aLdsAQTI9jqx5lySTcjuUrHzfdayQfKE PPSw== X-Gm-Message-State: AOAM5332DgE2fb3uzleQDqHqLBAfzFvC33VsWGlnIeLP7/eo0zxEiRST 0fESwTr7fKQajUpSdbW82ofY8BW6+FGr9Z6InZM= X-Google-Smtp-Source: ABdhPJwRBnQIE9fyzHcUKlmDar0BJIbkx4EMGjFuBXJ7p4Tf89F2FhJKcNeQ+wuZXPSGMyTRWnhoxBksGhz1JQSJTy8= X-Received: by 2002:aca:60d7:0:b0:325:54db:b78e with SMTP id u206-20020aca60d7000000b0032554dbb78emr8477944oib.259.1653879089314; Sun, 29 May 2022 19:51:29 -0700 (PDT) MIME-Version: 1.0 References: <17502-281a7aaacfaa872a@postgresql.org> <3722616.1653877139@sss.pgh.pa.us> <3727090.1653878700@sss.pgh.pa.us> In-Reply-To: <3727090.1653878700@sss.pgh.pa.us> From: David Rowley Date: Mon, 30 May 2022 14:51:16 +1200 Message-ID: Subject: Re: BUG #17502: View based on window functions returns wrong results when queried To: Tom Lane Cc: =?UTF-8?Q?Daniel_Farka=C5=A1?= , Magnus Hagander , PostgreSQL mailing lists Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 30 May 2022 at 14:45, Tom Lane wrote: > > David Rowley writes: > > On Mon, 30 May 2022 at 14:19, Tom Lane wrote: > >> I was sort of wondering why we allow SRFs in this context in the > >> first place. The results don't seem terribly well-defined to me. > > > Do you think it would fly to add such a restriction in the backbranches? > > We could leave it alone in the back branches on the grounds that if > you like the results you get, we shouldn't break it in a minor > release. I struggle to see how anyone would like their result correctness to depend on whether remove_unused_subquery_outputs() is able or unable to remove a column from the subquery. David