{"Entry":{"collection":"func","key":"lastval","name":"lastval","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"0b13e9dcaa5049605c63f08399ec9df6f48a82fe047c26d50195bc861db1f689","derived_content_hash":"f914402601c92b888665c4a43b10459466c9a733a05d9081398e2d0cfe3c11d8","first_version":"8.1","group":"sequence","group_label":"Sequence Manipulation Functions","groups":["sequence"],"imported_at":"2026-09-27T17:57:28.843461+08:00","last_version":"20","name":"lastval","name_key":"lastval","position":17001,"present_in":["8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"wiki-repair-20261023:4d6158c45820598e3b73145c4cbcb2aeffe7d886bf3a9077a467c2d8b243dbfc","receipt_sha256":"62a5457f100dd669a45100182d60c6bef99296d5aa222c352308f1775e7e24fc","repair":"wiki-repair-20261023"},"signature":"lastval () → bigint","signature_count":1,"slug":"lastval","source_rev":"wiki-repair-20261023:d0f272cb3028fe8334e96d2662b28896bc0ed27d86511d4dee11b7161604228a","summary":"Returns the value most recently returned by nextval in the current session.","summary_zh":""}},"Definition":{"Collection":"func","Key":"lastval","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"lastval","SourceRevision":"wiki-repair-20261023:d0f272cb3028fe8334e96d2662b28896bc0ed27d86511d4dee11b7161604228a","Facts":{"description":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","description_html":"Returns the value most recently returned by \u003ccode class=\"function\"\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode class=\"function\"\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode class=\"function\"\u003elastval\u003c/code\u003e if \u003ccode class=\"function\"\u003enextval\u003c/code\u003e has not yet been called in the current session.","description_zh":"返回 nextval 在当前会话中最近返回的值。这个函数与 currval 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 nextval 最近应用到的序列。如果在当前会话中还没有调用 nextval，那么调用 lastval 是一个错误。","description_zh_html":"返回 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 在当前会话中最近返回的值。这个函数与 \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 最近应用到的序列。如果在当前会话中还没有调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e，那么调用 \u003ccode class=\"function\"\u003elastval\u003c/code\u003e 是一个错误。","doc":{"anchor":"FUNCTIONS-SEQUENCE-TABLE","file":"functions-sequence.html","slug":"18"},"group":"sequence","group_label":"Sequence Manipulation Functions","lang":"en","layout":"table-new","pages":["functions-sequence.html"],"prose_only":false,"signatures":[{"description":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","description_html":"Returns the value most recently returned by \u003ccode class=\"function\"\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode class=\"function\"\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode class=\"function\"\u003elastval\u003c/code\u003e if \u003ccode class=\"function\"\u003enextval\u003c/code\u003e has not yet been called in the current session.","description_zh":"返回 nextval 在当前会话中最近返回的值。这个函数与 currval 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 nextval 最近应用到的序列。如果在当前会话中还没有调用 nextval，那么调用 lastval 是一个错误。","description_zh_html":"返回 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 在当前会话中最近返回的值。这个函数与 \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 最近应用到的序列。如果在当前会话中还没有调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e，那么调用 \u003ccode class=\"function\"\u003elastval\u003c/code\u003e 是一个错误。","examples":[],"html":"\u003ccode class=\"function\"\u003elastval\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"lastval () → bigint","zh_from":"same-version-pgdoc"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-sequence.html","sha256":"8fb4065539e7649b9d1c02d7f35333c8ae77e09b68ee1f92e78586894c7edaa6"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-SEQUENCE-TABLE","file":"functions-sequence.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"lastval","SourceDatabase":"center","Version":"18","Locale":"en","Title":"lastval","Summary":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","BodyHTML":"Returns the value most recently returned by \u003ccode\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode\u003elastval\u003c/code\u003e if \u003ccode\u003enextval\u003c/code\u003e has not yet been called in the current session.","SourceRevision":"wiki-repair-20261023:d0f272cb3028fe8334e96d2662b28896bc0ed27d86511d4dee11b7161604228a","ContentHash":"dd614581bc0e791a87de4052d29da830607baa911f2c31f544f3983b0f89ef6b","Payload":{"description":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","description_html":"Returns the value most recently returned by \u003ccode class=\"function\"\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode class=\"function\"\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode class=\"function\"\u003elastval\u003c/code\u003e if \u003ccode class=\"function\"\u003enextval\u003c/code\u003e has not yet been called in the current session.","signatures":[{"description":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","description_html":"Returns the value most recently returned by \u003ccode class=\"function\"\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode class=\"function\"\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode class=\"function\"\u003elastval\u003c/code\u003e if \u003ccode class=\"function\"\u003enextval\u003c/code\u003e has not yet been called in the current session.","description_zh":"返回 nextval 在当前会话中最近返回的值。这个函数与 currval 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 nextval 最近应用到的序列。如果在当前会话中还没有调用 nextval，那么调用 lastval 是一个错误。","description_zh_html":"返回 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 在当前会话中最近返回的值。这个函数与 \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 最近应用到的序列。如果在当前会话中还没有调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e，那么调用 \u003ccode class=\"function\"\u003elastval\u003c/code\u003e 是一个错误。","examples":[],"html":"\u003ccode class=\"function\"\u003elastval\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"lastval () → bigint","zh_from":"same-version-pgdoc"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"bc1242eb53bfbc126e084864881a06e0062a81c9508c5fdd78a29ee589896797","Text":"lastval () → bigint","Returns":"bigint","Payload":{"description":"Returns the value most recently returned by nextval in the current session. This function is identical to currval, except that instead of taking the sequence name as an argument it refers to whichever sequence nextval was most recently applied to in the current session. It is an error to call lastval if nextval has not yet been called in the current session.","description_html":"Returns the value most recently returned by \u003ccode class=\"function\"\u003enextval\u003c/code\u003e in the current session. This function is identical to \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e, except that instead of taking the sequence name as an argument it refers to whichever sequence \u003ccode class=\"function\"\u003enextval\u003c/code\u003e was most recently applied to in the current session. It is an error to call \u003ccode class=\"function\"\u003elastval\u003c/code\u003e if \u003ccode class=\"function\"\u003enextval\u003c/code\u003e has not yet been called in the current session.","description_zh":"返回 nextval 在当前会话中最近返回的值。这个函数与 currval 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 nextval 最近应用到的序列。如果在当前会话中还没有调用 nextval，那么调用 lastval 是一个错误。","description_zh_html":"返回 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 在当前会话中最近返回的值。这个函数与 \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 相同，不同之处在于它没有使用序列名作为参数，而是引用当前会话中 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 最近应用到的序列。如果在当前会话中还没有调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e，那么调用 \u003ccode class=\"function\"\u003elastval\u003c/code\u003e 是一个错误。","examples":[],"html":"\u003ccode class=\"function\"\u003elastval\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"lastval () → bigint","zh_from":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
