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.94.2) (envelope-from ) id 1t3Egv-00BNz5-JO for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2024 13:12:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t3Egs-00HAMf-W9 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Oct 2024 13:12:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3Egs-00HAJE-9P for pgsql-hackers@lists.postgresql.org; Tue, 22 Oct 2024 13:12:51 +0000 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3Egp-002Oae-NR; Tue, 22 Oct 2024 13:12:50 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0D089FF80A; Tue, 22 Oct 2024 13:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postgresfriends.org; s=gm1; t=1729602766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ERHR49NbVXSEVTY8LamSCQu3g2eyjXFquWcxkQkWtSc=; b=abzEB3Tr9dIAyO4QYIXIm6T6JK8OPdGt77sT8+Iju3a4GJY57ou0vabPLElP9/PPhIdezE QHAUUEOS+4Hoz8EOUFstW6sBHSKe3QhxjKuRhGCqrEcq0qvcI9CJ0bwmUU9EpVFalCl8pz PXFBEJsO9VWk6RXeTErRbkZc+xsy46f2YiQDbFH2C+HUdcrtbop5bDRCzJhEXLjzquUE0f iskTv758lCDELvOCYxmxz5aSst2cMg4L9+eKYmzgNstlEfu8i905NhYlgs0cVm76KumXU0 T/R6ZecCuVImx9q+rxCVY7g9GOzesTvpOTJPgHb5YLWR9cSt2kbOdANv2d/2pg== Content-Type: multipart/alternative; boundary="------------cBQPbY6I2HDZjMrT0Gj4COsP" Message-ID: Date: Tue, 22 Oct 2024 16:12:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Row pattern recognition To: Tatsuo Ishii , david.g.johnston@gmail.com Cc: jacob.champion@enterprisedb.com, pgsql-hackers@postgresql.org, er@xs4all.nl, peter@eisentraut.org References: <20241022.135343.842876007254579242.ishii@postgresql.org> <20241022.191909.2043328908414791518.ishii@postgresql.org> Content-Language: en-US From: Vik Fearing In-Reply-To: <20241022.191909.2043328908414791518.ishii@postgresql.org> X-GND-Sasl: vik@postgresfriends.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------cBQPbY6I2HDZjMrT0Gj4COsP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/10/2024 12:19, Tatsuo Ishii wrote: > Acording to ISO/IEC 9075-2:2016 "4.21.2 Row pattern navigation operations", > > evaluates a VE > in a row NR, which may be different than current row CR. > > From this I think PREV(col + 1) should be interpreted as: > > 1. go to the previous row. > 2. evaluate "col + 1" at the current row (that was previous row). > 3. return the result. > > If my understanding is correct, prev(price + 1) has the same meaning > as prev(price) + 1. This is how I read the specification also. -- Vik Fearing --------------cBQPbY6I2HDZjMrT0Gj4COsP Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 22/10/2024 12:19, Tatsuo Ishii wrote:
Acording to ISO/IEC 9075-2:2016 "4.21.2 Row pattern navigation operations",

  <row pattern navigation operation> evaluates a <value expression> VE
  in a row NR, which may be different than current row CR.

From this I think PREV(col + 1) should be interpreted as:

1. go to the previous row.
2. evaluate "col + 1" at the current row (that was previous row).
3. return the result.

If my understanding is correct, prev(price + 1) has the same meaning
as prev(price) + 1.



This is how I read the specification also.

--

Vik Fearing

--------------cBQPbY6I2HDZjMrT0Gj4COsP--