Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEu2l-00031U-5V for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 15:26:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pEu2j-0003g7-LN for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jan 2023 15:26:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEu2j-0003fy-CP for pgsql-hackers@lists.postgresql.org; Mon, 09 Jan 2023 15:26:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEu2h-0002WX-9j for pgsql-hackers@postgresql.org; Mon, 09 Jan 2023 15:26:32 +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 309FQNS54093783; Mon, 9 Jan 2023 10:26:23 -0500 From: Tom Lane To: Dean Rasheed cc: Paul Ramsey , Fabien COELHO , Michael Paquier , Justin Pryzby , pgsql-hackers@postgresql.org Subject: Re: [PATCH] random_normal function In-reply-to: References: <20221208224623.GQ27893@telsasoft.com> <20221231035804.GJ1153@telsasoft.com> <1682143.1672713508@sss.pgh.pa.us> <1776287.1672764097@sss.pgh.pa.us> <3983784.1673223640@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Mon, 09 Jan 2023 12:03:34 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4093781.1673277983.1@sss.pgh.pa.us> Date: Mon, 09 Jan 2023 10:26:23 -0500 Message-ID: <4093782.1673277983@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > So IMO all pseudorandom functions should share the same PRNG state and > seed-setting functions. That would mean they should all be in the same > (new) C file, so that the PRNG state can be kept private to that file. I agree with this in principle, but I feel no need to actually reshuffle the code before we accept a proposal for such a function that wouldn't logically belong in float.c. > I think it would also make sense to add a new "Random Functions" > section to the docs, and move the descriptions of random(), > random_normal() and setseed() there. Likewise, this'll just add confusion in the short run. A with only three functions in it is going to look mighty odd. regards, tom lane