Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wa9OK-001Z47-0z for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 09:50:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wa9OI-00AlBH-13 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Jun 2026 09:50:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wa9OI-00AlB9-08 for pgsql-hackers@lists.postgresql.org; Thu, 18 Jun 2026 09:50:30 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wa9OF-00000000x1o-0CBG for pgsql-hackers@postgresql.org; Thu, 18 Jun 2026 09:50:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=u7XbtEDhte2tmMNJPr4N+cVH+JR7s7WYRfaOrpjVERg=; b=Q7VxDFnRe7el6Z1O4yf8xxoOGu dHtbbTsgySYArfPvYWsczXkWTvR3LjCaQO7qwe6wimevPWF7UvKD7XvPOPZfQtO6NneotSyxN8aWV +CJvb/fSB3uGJ69gcZFP00jSs5kPFdsh5M472Moh4H0/ic60huo9LJXrXpv/dxbQxiTQUBanzgPsi /rVItrbBaSArB03IMraWOJQbPNnGaN7cNugEATcFGDduRwahOBH9q4tKaszrbZTyFumx/aKiT0xH2 tePce+x/3LEvnsOjJo6UGxNkNDYYRzMVToJhjCF2HJVDLhZkuFPxppeqwvJOFkAFbHtkKj45011lK zpEkxlRQ==; Received: from [2409:11:4120:300:8e11:36a:1d2a:5f51] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wa9O4-002jah-37; Thu, 18 Jun 2026 09:50:19 +0000 Date: Thu, 18 Jun 2026 18:50:07 +0900 (JST) Message-Id: <20260618.185007.1430819167281911424.ishii@postgresql.org> To: assam258@gmail.com Cc: jian.universality@gmail.com, zsolt.parragi@percona.com, sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Row pattern recognition From: Tatsuo Ishii In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:8e11:36a:1d2a:5f51 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Henson, > Hi Jian and Tatsuo, > > Thanks for the patch and the careful review. > > Tatsuo, item 1 below (attribute notation inside a DEFINE clause) is a > question for you; the rest is feedback on Jian's patch. > 1. Attribute notation inside a DEFINE clause, e.g. (f).prev. > > The guard this change removes is one I deliberately left undecided > during development (hence the XXX comment), so I'd keep it for now and > ask here. Without it, (f).prev with no such field gives a generic > "column \"prev\" not found ..." instead of the dedicated "cannot use > row pattern navigation function PREV in attribute notation". Three > options: > > (a) Treat (f).prev as an ordinary function (prev(f)), the same as > outside a DEFINE clause -- which is what the patch does. > > (b) Treat (f).prev as the navigation function -- read the attribute > notation as navigation. An ordinary function of that name is still > reachable as public.prev(...). > > (c) Reject the ambiguous (f).prev with a dedicated error (what is > currently committed), rather than resolving it one way or the > other. > > My own leaning is actually (a) -- it keeps attribute notation behaving > the same inside and outside a DEFINE clause. (c) is what's in the tree > now, and either way it changes the user-visible error and SQLSTATE, so > I'd rather settle this explicitly than let the refactor decide it > silently. Tatsuo, what do you think? I think either (a) or (c) is fine. (b) gives no clear benefit to users. Who want to write (f).prev? Also (f, 10).prev is a syntax error, which confuses users. If choosing (a) makes our code cleaner and more logical, I have no reason to against it. Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp