Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcef9-0007KZ-H2 for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Jul 2018 22:29:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fcef7-0004TP-OY for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Jul 2018 22:29:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcef7-0004TI-IT for pgsql-bugs@lists.postgresql.org; Mon, 09 Jul 2018 22:29:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcef4-0006J1-7n for pgsql-bugs@lists.postgresql.org; Mon, 09 Jul 2018 22:29:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w69MTYlw013421; Mon, 9 Jul 2018 18:29:34 -0400 From: Tom Lane To: lukas.eder@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15262: "unexpected end of tuplestore" error when using new GROUPS window function clause In-reply-to: <153086788677.17476.8002640580496698831@wrigleys.postgresql.org> References: <153086788677.17476.8002640580496698831@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Fri, 06 Jul 2018 09:04:46 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13419.1531175374.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 09 Jul 2018 18:29:34 -0400 Message-ID: <13420.1531175374@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?utf-8?q?PG_Bug_reporting_form?=3D writes: > This error can be reproduced easily as follows > postgres=3D# SELECT count(*) OVER (GROUPS 1 PRECEDING) FROM (VALUES (1= ), > (2), (2)) t(v); > ERROR: unexpected end of tuplestore In an assert-enabled build I get an assert failure from this. I think this is the same problem Masahiko Sawada noted in https://www.postgresql.org/message-id/CAD21AoDrWqycq-w_+Bx1cjc+YUhZ11XTj9r= fxNiNDojjBx8Fjw@mail.gmail.com and as in that thread, I think what we really should be doing here is giving a parse error. What would you expect GROUPS mode to do without an ORDER BY to define the grouping? regards, tom lane