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 1siaYr-006fUF-Dg for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Aug 2024 14:19:13 +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 1siaYp-00Ai7G-JJ for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Aug 2024 14:19:12 +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.94.2) (envelope-from ) id 1siaYp-00Ai4Q-9U for pgsql-hackers@lists.postgresql.org; Mon, 26 Aug 2024 14:19:11 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1siaYn-001X21-HM for pgsql-hackers@lists.postgresql.org; Mon, 26 Aug 2024 14:19:10 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-8278b0ba494so114623739f.3 for ; Mon, 26 Aug 2024 07:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724681949; x=1725286749; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YFJ01JmD3yPWqtC2WU2I0ftofMGQZqrW4HihtsG66Jc=; b=m+XVrNJfCFeMwHLV2jXmLN/Anuvvjtc+lUMEf9MXPi7+dnj9wGZwIsY99VKs9XHJCd dyRIxG+2xWPvO5ebO4lvZ10NLd8Rk3DOpw/aWhzBUX490veIku023FUqQzhgUr+g8akx Lau306Y5Fz1CcwWla+nHB3CxW4GfsR2mgNe80Zo0i4PCVDjybkOJSr7UVMNhhg+EuB1R iVzOkTZpUET++tJpCCYQVHbJW7SqTflbmxpow6GFp7UmHcU7evFNA+GazV8Wx9IpjI22 cO4mnCpWpHAKtFKIfYqt5m6uqLQ9jx+emiynvYChbCeB0ClmqG2zd5KZL7DS/S+BO6fl gbHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724681949; x=1725286749; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YFJ01JmD3yPWqtC2WU2I0ftofMGQZqrW4HihtsG66Jc=; b=bVuO03mfTtg7Wjb+trcqPuGFxXXFP6dpsEeG09dbrysLjHMVifXkBzpz7XEq+ZaNCq ksLDuUrbYs/foI5apAQRC3a1k5SO0KPe2rgH54KFoLp77HjMPFOTzpyTb+Gvo6Xn9uBY uzBGXiSuMTOKXqEeiZJ3Ryp5NoDj+U22bGJD54vr+zc7AzSbdfEK0Ve3T8DQaHjr2BJd 4hxR2X80t1ug663eEwAZ5jFE+fW7eOVtkZPnkQJ/2kMU6JmOGApee9L37bFQwwpzS/Z/ XKth+eoCHvQ5bxCq/Y5Vd7mQP90ao4SoPRQksGNOxe3VV7PnW5DxGSJF4UOB4bdKBLBE tLRQ== X-Gm-Message-State: AOJu0YyINEBV991VBCAFQ7wmw4vdQ538NXshiKf8/w8bos7PgpzviEXb OWiYuxAfAnNXJpiM1D/1MCeCM6n0Snlwa+8cP+lTBMbu3zyvtB4Dkj8VXA== X-Google-Smtp-Source: AGHT+IGE2lPXmiibx1/mO6EpCa7NFQ7/LEAbkuBJ8p7qO2bumTRU/p3InEjhvnb/AcJcUf7c1tYgHw== X-Received: by 2002:a05:6602:1683:b0:824:d703:fdef with SMTP id ca18e2360f4ac-8278731bf04mr1157266939f.2.1724681948728; Mon, 26 Aug 2024 07:19:08 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ce70f8540bsm2210936173.82.2024.08.26.07.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 07:19:08 -0700 (PDT) Date: Mon, 26 Aug 2024 09:19:06 -0500 From: Nathan Bossart To: Michael Paquier Cc: Postgres hackers Subject: Re: Removing log_cnt from pg_sequence_read_tuple() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 26, 2024 at 11:11:55AM +0900, Michael Paquier wrote: > It seems to me that we'd live better without it, at least it matters > for the sequence AM patch, because some of its callbacks are also > shaped around the fact that WAL may not be required for sequence value > computations. Providing a function that should be rather generic does > not fit well in this context, still I agree that it comes down to how > the callbacks are defined, of course. My point is that the use of WAL > is something that should be optional, but log_cnt in this function > makes it a mandatory concept that all sequence AMs would need to deal > with. I am fine with changes to this function that would allow it to be generically useful for all sequence AMs, provided that it can still be used for dumpSequenceData(). I only included log_cnt because pg_sequence_read_tuple() is intended to be a substitute for SELECT from the sequence, but I'm not aware of any real use-case for that column besides debugging, which you've already addressed. Even if we remove log_cnt, you can still find it with SELECT, too. The patch looks reasonable to me. Do you think the name of the function still makes sense now that 1) we might have different sequence AMs in the near future and 2) it no longer returns everything in the sequence tuple? -- nathan