{"Entry":{"collection":"func","key":"setval","name":"setval","aliases":[],"metadata":{"changed_in":["7.4","8.1"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"7.2"},{"descriptions_changed":false,"doc_overhaul":false,"from":"7.3","group_changed":null,"signatures":{"added":["setval ( text, bigint ) → bigint","setval ( text, bigint, boolean ) → bigint"],"removed":["setval ( text,bigint ) → bigint","setval ( text,bigint,boolean ) → bigint"]},"status":"changed","to":"7.4"},{"descriptions_changed":false,"doc_overhaul":false,"from":"8.0","group_changed":null,"signatures":{"added":["setval ( regclass, bigint ) → bigint","setval ( regclass, bigint, boolean ) → bigint"],"removed":["setval ( text, bigint ) → bigint","setval ( text, bigint, boolean ) → bigint"]},"status":"changed","to":"8.1"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"f378c765dfcee9ad37d4f50710bde436fdb3e8e216982206675fecc52ca3cbdb","derived_content_hash":"0f221524ae8499bc8a69e9eee2fd8e4e5401c6b43fca28ec56d9a1645262cd6e","first_version":"7.2","group":"sequence","group_label":"Sequence Manipulation Functions","groups":["sequence"],"imported_at":"2026-09-27T17:57:28.849303+08:00","last_version":"20","name":"setval","name_key":"setval","position":17004,"present_in":["7.2","7.3","7.4","8.0","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:46eae113ad130abc0343b1f742a0a0295cad9a61150973d715d8823ef15272e2","receipt_sha256":"8bb5ad9638da2eec4e57b03612dff1c2537c2eb06f886beff139feee7055390c","repair":"wiki-repair-20261023"},"signature":"setval ( regclass, bigint [, boolean ] ) → bigint","signature_count":1,"slug":"setval","source_rev":"wiki-repair-20261023:6c15ea0a305411d10e9b24cc9c17870a5924e8ab3cb498bdd4996e68e3e4affb","summary":"Sets the sequence object's current value, and optionally its is_called flag.","summary_zh":""}},"Definition":{"Collection":"func","Key":"setval","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"setval","SourceRevision":"wiki-repair-20261023:6c15ea0a305411d10e9b24cc9c17870a5924e8ab3cb498bdd4996e68e3e4affb","Facts":{"description":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","description_html":"Sets the sequence object's current value, and optionally its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence's \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e field to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e, meaning that the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e can be set to either \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e or \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e. \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e, the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode class=\"function\"\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","description_zh":"设置序列对象的当前值，并可选地设置其 is_called 标志。双参数形式将序列的 last_value 字段设置为指定的值，并将其 is_called 字段设置为 true，意味着下一个 nextval 将在返回值之前推进序列。currval 将报告的值也设置为指定的值。在三参数形式中，is_called 可以设置为 true 或 false。true 与双参数形式具有相同的效果。如果设置为 false，下一个 nextval 将返回指定的值，序列推进从再下一次调用 nextval 开始。而且，currval 报告的值在这种情况下不会改变。例如：","description_zh_html":"设置序列对象的当前值，并可选地设置其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 标志。双参数形式将序列的 \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e 字段设置为指定的值，并将其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 字段设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e，意味着下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将在返回值之前推进序列。\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 将报告的值也设置为指定的值。在三参数形式中，\u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 可以设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e。\u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 与双参数形式具有相同的效果。如果设置为 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e，下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将返回指定的值，序列推进从再下一次调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 开始。而且，\u003ccode class=\"function\"\u003ecurrval\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":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","description_html":"Sets the sequence object's current value, and optionally its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence's \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e field to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e, meaning that the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e can be set to either \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e or \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e. \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e, the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode class=\"function\"\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","description_zh":"设置序列对象的当前值，并可选地设置其 is_called 标志。双参数形式将序列的 last_value 字段设置为指定的值，并将其 is_called 字段设置为 true，意味着下一个 nextval 将在返回值之前推进序列。currval 将报告的值也设置为指定的值。在三参数形式中，is_called 可以设置为 true 或 false。true 与双参数形式具有相同的效果。如果设置为 false，下一个 nextval 将返回指定的值，序列推进从再下一次调用 nextval 开始。而且，currval 报告的值在这种情况下不会改变。例如：","description_zh_html":"设置序列对象的当前值，并可选地设置其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 标志。双参数形式将序列的 \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e 字段设置为指定的值，并将其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 字段设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e，意味着下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将在返回值之前推进序列。\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 将报告的值也设置为指定的值。在三参数形式中，\u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 可以设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e。\u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 与双参数形式具有相同的效果。如果设置为 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e，下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将返回指定的值，序列推进从再下一次调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 开始。而且，\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 报告的值在这种情况下不会改变。例如：","examples":[],"html":"\u003ccode class=\"function\"\u003esetval\u003c/code\u003e ( \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"setval ( regclass, bigint [, boolean ] ) → 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":"setval","SourceDatabase":"center","Version":"18","Locale":"en","Title":"setval","Summary":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","BodyHTML":"Sets the sequence object\u0026#39;s current value, and optionally its \u003ccode\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence\u0026#39;s \u003ccode\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode\u003eis_called\u003c/code\u003e field to \u003ccode\u003etrue\u003c/code\u003e, meaning that the next \u003ccode\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode\u003eis_called\u003c/code\u003e can be set to either \u003ccode\u003etrue\u003c/code\u003e or \u003ccode\u003efalse\u003c/code\u003e. \u003ccode\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode\u003efalse\u003c/code\u003e, the next \u003ccode\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","SourceRevision":"wiki-repair-20261023:6c15ea0a305411d10e9b24cc9c17870a5924e8ab3cb498bdd4996e68e3e4affb","ContentHash":"91da9d8e15665e79270f65451432d372f92a09916f90337fc8b8283ab7fe14ff","Payload":{"description":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","description_html":"Sets the sequence object's current value, and optionally its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence's \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e field to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e, meaning that the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e can be set to either \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e or \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e. \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e, the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode class=\"function\"\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","signatures":[{"description":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","description_html":"Sets the sequence object's current value, and optionally its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence's \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e field to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e, meaning that the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e can be set to either \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e or \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e. \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e, the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode class=\"function\"\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","description_zh":"设置序列对象的当前值，并可选地设置其 is_called 标志。双参数形式将序列的 last_value 字段设置为指定的值，并将其 is_called 字段设置为 true，意味着下一个 nextval 将在返回值之前推进序列。currval 将报告的值也设置为指定的值。在三参数形式中，is_called 可以设置为 true 或 false。true 与双参数形式具有相同的效果。如果设置为 false，下一个 nextval 将返回指定的值，序列推进从再下一次调用 nextval 开始。而且，currval 报告的值在这种情况下不会改变。例如：","description_zh_html":"设置序列对象的当前值，并可选地设置其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 标志。双参数形式将序列的 \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e 字段设置为指定的值，并将其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 字段设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e，意味着下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将在返回值之前推进序列。\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 将报告的值也设置为指定的值。在三参数形式中，\u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 可以设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e。\u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 与双参数形式具有相同的效果。如果设置为 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e，下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将返回指定的值，序列推进从再下一次调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 开始。而且，\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 报告的值在这种情况下不会改变。例如：","examples":[],"html":"\u003ccode class=\"function\"\u003esetval\u003c/code\u003e ( \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"setval ( regclass, bigint [, boolean ] ) → bigint","zh_from":"same-version-pgdoc"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.2","7.3","7.4","8.0","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":"abe1468b72bff8fb126f32bee0786b50e264a9d58205b359803267b02a28421f","Text":"setval ( regclass, bigint [, boolean ] ) → bigint","Returns":"bigint","Payload":{"description":"Sets the sequence object's current value, and optionally its is_called flag. The two-parameter form sets the sequence's last_value field to the specified value and sets its is_called field to true, meaning that the next nextval will advance the sequence before returning a value. The value that will be reported by currval is also set to the specified value. In the three-parameter form, is_called can be set to either true or false. true has the same effect as the two-parameter form. If it is set to false, the next nextval will return exactly the specified value, and sequence advancement commences with the following nextval. Furthermore, the value reported by currval is not changed in this case. For example,","description_html":"Sets the sequence object's current value, and optionally its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e flag. The two-parameter form sets the sequence's \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e field to the specified value and sets its \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e field to \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e, meaning that the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will advance the sequence before returning a value. The value that will be reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is also set to the specified value. In the three-parameter form, \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e can be set to either \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e or \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e. \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e has the same effect as the two-parameter form. If it is set to \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e, the next \u003ccode class=\"function\"\u003enextval\u003c/code\u003e will return exactly the specified value, and sequence advancement commences with the following \u003ccode class=\"function\"\u003enextval\u003c/code\u003e. Furthermore, the value reported by \u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e is not changed in this case. For example,","description_zh":"设置序列对象的当前值，并可选地设置其 is_called 标志。双参数形式将序列的 last_value 字段设置为指定的值，并将其 is_called 字段设置为 true，意味着下一个 nextval 将在返回值之前推进序列。currval 将报告的值也设置为指定的值。在三参数形式中，is_called 可以设置为 true 或 false。true 与双参数形式具有相同的效果。如果设置为 false，下一个 nextval 将返回指定的值，序列推进从再下一次调用 nextval 开始。而且，currval 报告的值在这种情况下不会改变。例如：","description_zh_html":"设置序列对象的当前值，并可选地设置其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 标志。双参数形式将序列的 \u003ccode class=\"literal\"\u003elast_value\u003c/code\u003e 字段设置为指定的值，并将其 \u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 字段设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e，意味着下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将在返回值之前推进序列。\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 将报告的值也设置为指定的值。在三参数形式中，\u003ccode class=\"literal\"\u003eis_called\u003c/code\u003e 可以设置为 \u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e。\u003ccode class=\"literal\"\u003etrue\u003c/code\u003e 与双参数形式具有相同的效果。如果设置为 \u003ccode class=\"literal\"\u003efalse\u003c/code\u003e，下一个 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 将返回指定的值，序列推进从再下一次调用 \u003ccode class=\"function\"\u003enextval\u003c/code\u003e 开始。而且，\u003ccode class=\"function\"\u003ecurrval\u003c/code\u003e 报告的值在这种情况下不会改变。例如：","examples":[],"html":"\u003ccode class=\"function\"\u003esetval\u003c/code\u003e ( \u003ccode class=\"type\"\u003eregclass\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigint\u003c/code\u003e [\u003cspan class=\"optional\"\u003e, \u003ccode class=\"type\"\u003eboolean\u003c/code\u003e\u003c/span\u003e ] ) → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"setval ( regclass, bigint [, boolean ] ) → bigint","zh_from":"same-version-pgdoc"}}],"Spellings":null,"SQLState":null,"Evidence":null}
