Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i60f9-0007b8-Cc for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Sep 2019 22:55:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i60f8-0002xf-03 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Sep 2019 22:55:34 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1i60bq-0005EP-Ll for pgsql-hackers@lists.postgresql.org; Thu, 05 Sep 2019 22:52:10 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i60bj-0006AK-MY for pgsql-hackers@postgresql.org; Thu, 05 Sep 2019 22:52:10 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5780121B7C; Thu, 5 Sep 2019 18:52:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 05 Sep 2019 18:52:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=EfJ5lz8wZOssThBtJFL4HL53kNPTN5t6PuBEoIjbSLE=; b=H7mUdX3i h9F+Sii6JVdXllt05H9C+1fFOvG15lCYjmEmFWmWTVDgVZGRKmuM3/c/8JzZ697Z x0CF6nAk3KUrTfz0vvQv+XtGtgkQHP3KL1hYjYAZPigO9UyNw7CVaMD7SS5AV0YY kNZg5jm+T3OhCjjr+lRtWuxFiX1IRG0JpP0h4aLEaPMIygbQ88o7h5l0Y3p8lkA8 QV/WHm6JBQ0GH7cva5lbTMvNmPG/ukJohkyeSEACq9PIpvM5pz1Mjl7RzXGFe+8C U4BJ2GzQs/QXzJAKUDsDuuFbg4RKopSBB5tETX+peZkXpg3Gdw40CG2h98Gk3LnF I/HuAvXjdN+Uhw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejkedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruchfrhhomhcuvdhnugfsuhgrughrrghnthcuoegrlhhvhhgvrh hrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenucffohhmrghinhepvdhnughquhgrughr rghnthdrtghomhenucfkphepudeltddruddvuddrvdelrdefnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgnecuvehluhhs thgvrhfuihiivgeptd X-ME-Proxy: Received: from nimloth.alvh.no-ip.org (unknown [190.121.29.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 5274AD60066; Thu, 5 Sep 2019 18:52:01 -0400 (EDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 953EF120BB0; Thu, 5 Sep 2019 18:51:58 -0400 (-04) Date: Thu, 5 Sep 2019 18:51:58 -0400 From: Alvaro Herrera from 2ndQuadrant To: Surafel Temesgen Cc: Erik Rijkers , Thomas Munro , Tomas Vondra , David Steele , Michael Paquier , Robert Haas , Andrew Gierth , PostgreSQL Hackers Subject: Re: FETCH FIRST clause WITH TIES option Message-ID: <20190905225158.GA30717@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk As Tom just said in the thread for PERCENT, the gram.y changes need a better representation. Also, rename EXACT_NUMBER, per that thread. As far as I can tell, this concerns feature F867. I think we should mark that as supported after this patch -- please edit src/backend/catalog/sql_features.txt. Earlier in the thread, Tomas Vondra said: > 3) I'm a bit confused by the initialization added to ExecInitLimit. It > first gets the tuple descriptor from the limitstate (it should not do so > directly but use ExecGetResultType). But when it creates the extra slot, > it uses ops extracted from the outer plan. That's strange, I guess ... > > And then it extracts the descriptor from the outer plan and uses it when > calling execTuplesMatchPrepare. But AFAIK it's going to be compared to > the last_slot, which is using a descriptor from the limitstate. > > IMHO all of this should use descriptor/ops from the outer plan, no? It > probably does not change anything because limit does not project, but it > seems confusing. and you replied: > agree ... yet this doesn't appear to have resulted in any change in the code, or I just missed it. Are you going to update the patch per that? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services