You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<
8000
script type="application/json" data-target="react-app.embeddedData">{"payload":{"commit":{"oid":"d4f109e4a2c028bcd889cc44d84b10fff7d9186b","url":"/postgres/postgres/commit/d4f109e4a2c028bcd889cc44d84b10fff7d9186b","authoredDate":"2022-04-12T11:36:45.000-04:00","committedDate":"2022-04-12T11:36:45.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eDoc: update description of random() function.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/3804539e48e794781c6145c7f988f5d507418fa8/hovercard\" href=\"https://github.com/postgres/postgres/commit/3804539e48e794781c6145c7f988f5d507418fa8\"\u003e\u003ctt\u003e3804539\u003c/tt\u003e\u003c/a\u003e neglected to update the documentation's claim that\nrandom() uses a \"linear congruential algorithm\". In hopes of avoiding\nthe same mistake if someone replaces our PRNG again, just say it's a\ndeterministic pseudo-random number generator and leave it at that.\nAnybody who really wants to know can look in the source code.\n\nCOMPATIBILITY NOTE FOR RELEASE NOTES: \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/3804539e48e794781c6145c7f988f5d507418fa8/hovercard\" href=\"https://github.com/postgres/postgres/commit/3804539e48e794781c6145c7f988f5d507418fa8\"\u003e\u003ctt\u003e3804539\u003c/tt\u003e\u003c/a\u003e's commit message\nreally should have mentioned that the random() sequence after\nsetseed(), while still repeatable, will differ from what you got\nin pre-v15 releases.\n\nNoted by Dagfinn Ilmari Mannsåker; wording suggestion by Dean Rasheed.\n\nDiscussion: \u003ca href=\"https://postgr.es/m/875ynfpiru.fsf@wibble.ilmari.org\" rel=\"nofollow\"\u003ehttps://postgr.es/m/875ynfpiru.fsf@wibble.ilmari.org\u003c/a\u003e","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["e7cc4a6e3dcc39f3643f998aa5da6a6f27f28db5"],"globalRelayId":"C_kwDOAA4m0toAKGQ0ZjEwOWU0YTJjMDI4YmNkODg5Y2M0NGQ4NGIxMGZmZjdkOTE4NmI","sha1":"e7cc4a6e3dcc39f3643f998aa5da6a6f27f28db5","sha2":"d4f109e4a2c028bcd889cc44d84b10fff7d9186b"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":1831,"text":"@@ -1832,8 +1832,9 @@ repeat('Pg', 4) \u003creturnvalue\u003ePgPgPgPg\u003c/returnvalue\u003e","html":"@@ -1832,8 +1832,9 @@ repeat(\u0026#39;Pg\u0026#39;, 4) \u0026lt;returnvalue\u0026gt;PgPgPgPg\u0026lt;/returnvalue\u0026gt;","displayNoNewLineWarning":false,"position":0,"left":1831,"right":1831},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1832,"text":" \u003c/table\u003e","html":" \u0026lt;/table\u0026gt;","displayNoNewLineWarning":false,"position":1,"left":1832,"right":1832},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1833,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":2,"left":1833,"right":1833},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1834,"text":" \u003cpara\u003e","html":" \u0026lt;para\u0026gt;","displayNoNewLineWarning":false,"position":3,"left":1834,"right":1834},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1835,"text":"- The \u003cfunction\u003erandom()\u003c/function\u003e function uses a simple linear","html":"- The \u0026lt;function\u0026gt;random()\u0026lt;/function\u0026gt; function uses a simple linear","displayNoNewLineWarning":false,"position":4,"left":1835,"right":1834},{"stylingDirective":null,"type":"DELETION","blobLineNumber":1836,"text":"- congruential algorithm. It is fast but not suitable for cryptographic","html":"- congruential algorithm. It is fast but not suitable for cryptographic","displayNoNewLineWarning":false,"position":5,"left":1836,"right":1834},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1835,"text":"+ The \u003cfunction\u003erandom()\u003c/function\u003e function uses a deterministic","html":"+ The \u0026lt;function\u0026gt;random()\u0026lt;/function\u0026gt; function uses a deterministic","displayNoNewLineWarning":false,"position":6,"left":1836,"right":1835},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1836,"text":"+ pseudo-random number generator.","html":"+ pseudo-random number generator.","displayNoNewLineWarning":false,"position":7,"left":1836,"right":1836},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":1837,"text":"+ It is fast but not suitable for cryptographic","html":"+ It is fast but not suitable for cryptographic","displayNoNewLineWarning":false,"position":8,"left":1836,"right":1837},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1838,"text":" applications; see the \u003cxref linkend=\"pgcrypto\"/\u003e module for a more","html":" applications; see the \u0026lt;xref linkend=\u0026quot;pgcrypto\u0026quot;/\u0026gt; module for a more","displayNoNewLineWarning":false,"position":9,"left":1837,"right":1838},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1839,"text":" secure alternative.","html":" secure alternative.","displayNoNewLineWarning":false,"position":10,"left":1838,"right":1839},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":1840,"text":" If \u003cfunction\u003esetseed()\u003c/function\u003e is called, the series of results of","html":" If \u0026lt;function\u0026gt;setseed()\u0026lt;/function\u0026gt; is called, the series of results of","displayNoNewLineWarning":false,"position":11,"left":1839,"right":1840}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":30963,"linesChanged":5,"newTreeEntry":{"lineCount":30963,"path":"doc/src/sgml/func.sgml","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"doc/src/sgml/func.sgml","mode":100644},"linesAdded":3,"linesDeleted":2,"path":"doc/src/sgml/func.sgml","pathDigest":"229a1fe1ecaae95e35dcb9270c20c6d0bf37f33fbf019dfbd7f9ef014b07c0e3","status":"MODIFIED","truncatedReason":null,"oldOid":"e7cc4a6e3dcc39f3643f998aa5da6a6f27f28db5","newOid":"d4f109e4a2c028bcd889cc44d84b10fff7d9186b","copilotChatReference":null,"deletedSha":"e7cc4a6e3dcc39f3643f998aa5da6a6f27f28db5","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/d4f109e4a2c028bcd889cc44d84b10fff7d9186b","fileTreeExpanded":true,"headerInfo":{"additions":3,"deletions":2,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":564,"lineShownCount":12},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"ou5gHeyMig4nDShXsROgd1hu3VvVxXqIls7f2eHMUyW5KdSD_YWMFVuY_SQ7gU2189-aGIoF46i06jXXdhObXA"},"/users/diffview?diff=unified":{"post":"WZxUX1MQExEA5PSSdpmZm8P3q7dBDkK6MMCCsqQiaWJCW-DBQhkVCnxxIeH8C3RZaEbs9B7O25oS5Gi8M_2hGw"},"/notifications/thread":{"post":"zb7Bi-aP-l8HlW0KlATC0cdjkUX8bsH99d3lkxbYo55eOlP-ndN-Q_HNu5bx0m4SuiJ21OILhubhUUGpA_qMAA"}}},"title":"Doc: update description of random() function. · postgres/postgres@d4f109e","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}
Commit 3804539 neglected to update the documentation's claim that
random() uses a "linear congruential algorithm". In hopes of avoiding
the same mistake if someone replaces our PRNG again, just say it's a
deterministic pseudo-random number generator and leave it at that.
Anybody who really wants to know can look in the source code.
COMPATIBILITY NOTE FOR RELEASE NOTES: 3804539's commit message
really should have mentioned that the random() sequence after
setseed(), while still repeatable, will differ from what you got
in pre-v15 releases.
Noted by Dagfinn Ilmari Mannsåker; wording suggestion by Dean Rasheed.
Discussion: https://postgr.es/m/875ynfpiru.fsf@wibble.ilmari.org
0 commit comments