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 1rdval-008Lsb-3J for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Feb 2024 17:13:39 +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 1rdvaj-005Jbw-OW for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Feb 2024 17:13:38 +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 1rdvXh-005GgS-VT for pgsql-hackers@lists.postgresql.org; Sat, 24 Feb 2024 17:10:30 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rdvXa-000nFf-15 for pgsql-hackers@lists.postgresql.org; Sat, 24 Feb 2024 17:10:29 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5654f700705so2331683a12.1 for ; Sat, 24 Feb 2024 09:10:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1708794620; x=1709399420; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=87pRLko9dVc5ub2ZI8M8kjLeIJC3AV/kYrZLjAb2iS0=; b=lIZkyteXRu0rlq/rLBsfwTj6ypgIBYCPX4oiTcz+FRum3HNhu1DuP0aTGwPmHWFDon rqLCug/x6WJrrUOjDZIXZWJp/ECUEgRrJcNGdQzJNiXiKoY6Uh4pWjlqWskGxcy61qMM 4fmRQlIKy37Y1JRj5yEik4D68U/p+1rsDVbKScn5QUnyKgrpQiLD3lAFoOHu5fQowxTm fUNYmHKRByb94qvwvJPgrmMVEJLD0TaLTgzw6iSDL5/13rlM30SdSjRRqXCPTRJoosef zcBsgQCxKpx3ikHzl9PBOlyFaf6mIn0HwiykrN5lRCOv7zcL0LjdUTar8X8qbt1KdtFd km0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708794620; x=1709399420; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=87pRLko9dVc5ub2ZI8M8kjLeIJC3AV/kYrZLjAb2iS0=; b=ld3xsMK37x1s0OghsWcCHATfJebDdZcv4cCYzSAiHWa1emYJK0/Ms3Gh7Zn6TddBBW ahkKswi7JKsdBRxVVwfKj7yWn8MOEh0iY9MqEC9rq6Bt3lU9iRt9n7DZFnFLAPyqIhF2 DYQBWckz+q0NzwU3cP9phnr5GIJkFLXn4h6uQYSJhaDkuN2QhdGiogAJg24zlSJUGD+D V1Np9P0Yz5xuGITOaiGYC8tozT2In4cvYGNwqgpo4RB70rfWAu22g8nd5TlqB33JCEaZ uzIwvhBkpzP+vHCHog9DUGq1N4ziY52j05B022X/hluoPmbg83jj8JR4Fzv75fkdmUWD C/jg== X-Forwarded-Encrypted: i=1; AJvYcCUT8S9chsG047uTv1lciVpbMAlOuvErQQ4hEf/D9ePYhvqskR5wlGz09n3QhYO6CnEbaQpXmxvDeoem0jUam/EIrWr+G7O+TCJK1BiGwg4zDyx/ X-Gm-Message-State: AOJu0YxFsV3o/sXOpBU5OraaomLeo/uKgUE+CtFKjQziZdg7/DbjhKok 2CGRVIlSbW3MVxmlsJfsLrjUzGOej/+CFgAwxjs6jaCB8hJaEAuypT7S5UHgdA== X-Google-Smtp-Source: AGHT+IEqSdOjN3og5LF4gqFlOsCmrTCNvmw2GW67xwhNyDWnR3JYzerxpebEFhVkev+tcedK8FukoQ== X-Received: by 2002:aa7:c64d:0:b0:565:9938:a881 with SMTP id z13-20020aa7c64d000000b005659938a881mr1795220edr.36.1708794620230; Sat, 24 Feb 2024 09:10:20 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id w14-20020a056402128e00b00563d03030e8sm694664edv.55.2024.02.24.09.10.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Feb 2024 09:10:19 -0800 (PST) Message-ID: <66df9a53-4fd8-448d-87b3-fd15b2d77ea2@enterprisedb.com> Date: Sat, 24 Feb 2024 18:10:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Functions to return random numbers in a given range To: Dean Rasheed , David Zhang Cc: Pavel Stehule , PostgreSQL Hackers References: Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Dean, I did a quick review and a little bit of testing on the patch today. I think it's a good/useful idea, and I think the code is ready to go (the code is certainly much cleaner than anything I'd written ...). I do have one minor comments regarding the docs - it refers to "random functions" in a couple places, which sounds to me as if it was talking about some functions arbitrarily taken from some list, although it clearly means "functions generating random numbers". (I realize this might be just due to me not being native speaker.) Did you think about adding more functions generating either other types of data distributions (now we have uniform and normal), or random data for other data types (I often need random strings, for example)? Of course, I'm not saying this patch needs to do that. But perhaps it might affect how we name stuff to make it "extensible". regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company