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 1oFMy6-0002L7-A2 for pgsql-sql@arkaria.postgresql.org; Sat, 23 Jul 2022 21:47:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oFMy4-0000Vf-TN for pgsql-sql@arkaria.postgresql.org; Sat, 23 Jul 2022 21:47:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFMy4-0000VV-K8 for pgsql-sql@lists.postgresql.org; Sat, 23 Jul 2022 21:47:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFMy0-00029P-Po for pgsql-sql@lists.postgresql.org; Sat, 23 Jul 2022 21:47:23 +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 26NLlJ3p1220339; Sat, 23 Jul 2022 17:47:19 -0400 From: Tom Lane To: Carl Sopchak cc: pgsql-sql@lists.postgresql.org Subject: Re: What seed does random() use if setseed() is not called first? In-reply-to: References: Comments: In-reply-to Carl Sopchak message dated "Sat, 23 Jul 2022 17:18:40 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1220337.1658612839.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 23 Jul 2022 17:47:19 -0400 Message-ID: <1220338.1658612839@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Carl Sopchak writes: >

There is one point about the documentation for random() and > setseed() that is missing.  What is used to seed random() if > setseed() isn't called first?  I assume it's something like > /dev/random or /dev/urandom, but that's just a guess.  Can someone > please enlighten me?

We don't document this because it's platform- and version-dependent, but yeah, generally /dev/urandom or local equivalent. regards, tom lane