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 1fKBTX-0002CY-3T for pgsql-hackers@arkaria.postgresql.org; Sat, 19 May 2018 23:41:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKBTU-0003Tz-Ey for pgsql-hackers@arkaria.postgresql.org; Sat, 19 May 2018 23:41:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKBTT-0003Tp-Vg for pgsql-hackers@lists.postgresql.org; Sat, 19 May 2018 23:41:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKBTM-0004j5-Sy for pgsql-hackers@postgresql.org; Sat, 19 May 2018 23:41:18 +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 w4JNfAiG025268; Sat, 19 May 2018 19:41:10 -0400 From: Tom Lane To: Vik Fearing cc: Andrew Gierth , pgsql-hackers@postgresql.org Subject: Re: Fix for FETCH FIRST syntax problems In-reply-to: <03da97fc-9d6b-cbe1-c28f-cee7c1ba5c38@2ndquadrant.com> References: <877enz476l.fsf@news-spur.riddles.org.uk> <22981.1526770675@sss.pgh.pa.us> <03da97fc-9d6b-cbe1-c28f-cee7c1ba5c38@2ndquadrant.com> Comments: In-reply-to Vik Fearing message dated "Sun, 20 May 2018 01:27:30 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25266.1526773270.1@sss.pgh.pa.us> Date: Sat, 19 May 2018 19:41:10 -0400 Message-ID: <25267.1526773270@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Vik Fearing writes: > On 20/05/18 00:57, Tom Lane wrote: >> Also, why'd you back off "must write" to "should write" in the docs? >> This doesn't make the parens any more optional than before. > It certainly does. It allows this now: > PREPARE foo AS TABLE bar FETCH FIRST $1 ROWS ONLY; No, it makes the parens omittable in the cases specified in the previous sentence. The sentence I'm complaining about is describing other cases, in which they're still required. > I'm +1 for backpatching it. It may be operating as designed by PeterE > ten years ago, but it's not operating as designed by the SQL standard. By that argument, *anyplace* where we're missing a SQL-spec feature is a back-patchable bug. I don't buy it. It may be that this fix is simple and safe enough that the risk/reward tradeoff favors back-patching, but I think you have to argue it as a favorable tradeoff rather than just saying "this isn't per standard". Consider: if Andrew had completely rewritten gram.y to get the same visible effect, would you think that was back-patchable? regards, tom lane