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 1u2GGn-00FSkV-EM for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 21:14:09 +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 1u2GGl-00FdT6-8q for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 21:14:07 +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 1u2GGk-00FdSy-Un for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 21:14:07 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2GGj-003kbc-1O for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 21:14:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 538LDw0Z4076865; Tue, 8 Apr 2025 17:13:59 -0400 From: Tom Lane To: Heikki Linnakangas cc: Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: Move tests of contrib/spi/ out of the core regression tests In-reply-to: <350fb18c-dce6-4db3-aed7-ac8711c9ab62@iki.fi> References: <3872677.1744077559@sss.pgh.pa.us> <33bd7e6e-b652-46f2-a911-f0ba8909d060@iki.fi> <692d7335-0b65-48c5-a731-afc2c90e35ab@dunslane.net> <3975773.1744120535@sss.pgh.pa.us> <350fb18c-dce6-4db3-aed7-ac8711c9ab62@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 08 Apr 2025 22:51:54 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4076863.1744146838.1@sss.pgh.pa.us> Date: Tue, 08 Apr 2025 17:13:58 -0400 Message-ID: <4076864.1744146838@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Heikki Linnakangas writes: > On 08/04/2025 16:55, Tom Lane wrote: >> + The trigger will replace the field's value only if that value is >> + initially zero or null (after the action of the SQL statement that >> + inserted or updated the row). Also, if the sequence's next value is >> + zero, nextval() will be called a second time in >> + order to obtain a non-zero value. > That's a much clearer explanation of the behavior, but now that I read > that paragraph, I wonder *why* it behaves like that. I'm sure it's just > historical reasons. But perhaps we should nuke autoinc altogether? Yeah, we were kind of wondering that about refint.c as well. But in the end, none of the stuff in contrib/spi/ has much value as production code. It's meant to be examples you can start from and modify. In that light, I'm more worried about whether the coding style is good than whether the definition is useful. In any case, if we decided to nuke the modules entirely, we'd still need half of the present patch in order to remove the core tests' dependency on them. So I'll go ahead and push this, and then we have a more self-contained target if we decide we don't want 'em. regards, tom lane