{"Entry":{"collection":"func","key":"pg-get-serial-sequence","name":"pg_get_serial_sequence","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"7.4","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.0"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"9.2"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.6","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"10"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"18","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"19"}],"content_hash":"4d408877d1c78ae1795fe48ea19537fdb16271f19e5a2c30b098a65f6010d016","first_version":"8.0","group":"info","group_label":"System Information Functions And Operators","groups":["info"],"imported_at":"2026-09-27T17:57:29.212206+08:00","last_version":"20","name":"pg_get_serial_sequence","name_key":"pg_get_serial_sequence","position":28071,"present_in":["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"],"signature":"pg_get_serial_sequence ( table text, column text ) → text","signature_count":1,"slug":"pg-get-serial-sequence","source_rev":"b7bd9cda","summary":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column.","summary_zh":""}},"Definition":{"Collection":"func","Key":"pg-get-serial-sequence","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"pg-get-serial-sequence","SourceRevision":"b7bd9cda","Facts":{"description":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (serial, smallserial, bigserial), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with ALTER SEQUENCE OWNED BY. (This function probably should have been called pg_get_owned_sequence; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see Section 9.17).","description_html":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (\u003ccode class=\"type\"\u003eserial\u003c/code\u003e, \u003ccode class=\"type\"\u003esmallserial\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigserial\u003c/code\u003e), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with \u003ccode class=\"command\"\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e. (This function probably should have been called \u003ccode class=\"function\"\u003epg_get_owned_sequence\u003c/code\u003e; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see \u003ca href=\"/docs/18/functions-sequence.html\" title=\"9.17. Sequence Manipulation Functions\"\u003eSection 9.17\u003c/a\u003e).","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-INFO-CATALOG-TABLE","file":"functions-info.html","slug":"18"},"group":"info","group_label":"System Information Functions And Operators","lang":"en","layout":"table-new","pages":["functions-info.html"],"prose_only":false,"signatures":[{"description":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (serial, smallserial, bigserial), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with ALTER SEQUENCE OWNED BY. (This function probably should have been called pg_get_owned_sequence; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see Section 9.17).","description_html":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (\u003ccode class=\"type\"\u003eserial\u003c/code\u003e, \u003ccode class=\"type\"\u003esmallserial\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigserial\u003c/code\u003e), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with \u003ccode class=\"command\"\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e. (This function probably should have been called \u003ccode class=\"function\"\u003epg_get_owned_sequence\u003c/code\u003e; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see \u003ca href=\"/docs/18/functions-sequence.html\" title=\"9.17. Sequence Manipulation Functions\"\u003eSection 9.17\u003c/a\u003e).","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_get_serial_sequence\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_get_serial_sequence ( table text, column text ) → text","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-INFO-CATALOG-TABLE","file":"functions-info.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"pg-get-serial-sequence","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_get_serial_sequence","Summary":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（serial、smallserial、bigserial）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用ALTER SEQUENCE OWNED BY修改或删除关联。（这个函数可能应该被称为pg_get_owned_sequence；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见第 9.17 节）。","BodyHTML":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（\u003ccode\u003eserial\u003c/code\u003e、\u003ccode\u003esmallserial\u003c/code\u003e、\u003ccode\u003ebigserial\u003c/code\u003e）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用\u003ccode\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e修改或删除关联。（这个函数可能应该被称为\u003ccode\u003epg_get_owned_sequence\u003c/code\u003e；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见\u003ca href=\"/docs/18/functions-sequence.html\" rel=\"nofollow\"\u003e第 9.17 节\u003c/a\u003e）。\u003cpre\u003epg_get_serial_sequence ( table text, column text ) → text\u003c/pre\u003e返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（\u003ccode\u003eserial\u003c/code\u003e、\u003ccode\u003esmallserial\u003c/code\u003e、\u003ccode\u003ebigserial\u003c/code\u003e）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用\u003ccode\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e修改或删除关联。（这个函数可能应该被称为\u003ccode\u003epg_get_owned_sequence\u003c/code\u003e；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见\u003ca href=\"/docs/18/functions-sequence.html\" rel=\"nofollow\"\u003e第 9.17 节\u003c/a\u003e）。","SourceRevision":"ca936764","ContentHash":"94cbe77271480897b620c9e60a661a941c5bc0b185a61152220b21e0dcb52d03","Payload":{"description_zh":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（serial、smallserial、bigserial）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用ALTER SEQUENCE OWNED BY修改或删除关联。（这个函数可能应该被称为pg_get_owned_sequence；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见第 9.17 节）。","description_zh_html":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（\u003ccode class=\"type\"\u003eserial\u003c/code\u003e、\u003ccode class=\"type\"\u003esmallserial\u003c/code\u003e、\u003ccode class=\"type\"\u003ebigserial\u003c/code\u003e）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用\u003ccode class=\"command\"\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e修改或删除关联。（这个函数可能应该被称为\u003ccode class=\"function\"\u003epg_get_owned_sequence\u003c/code\u003e；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见\u003ca href=\"/docs/18/functions-sequence.html\" title=\"9.17. 序列操作函数\"\u003e第 9.17 节\u003c/a\u003e）。","signatures":[{"description_zh":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（serial、smallserial、bigserial）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用ALTER SEQUENCE OWNED BY修改或删除关联。（这个函数可能应该被称为pg_get_owned_sequence；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见第 9.17 节）。","description_zh_html":"返回与列相关联的序列名称，如果没有序列与该列相关联则返回NULL。如果列是标识列，则关联序列是在内部为该列创建的序列。对于使用一种 serial 类型（\u003ccode class=\"type\"\u003eserial\u003c/code\u003e、\u003ccode class=\"type\"\u003esmallserial\u003c/code\u003e、\u003ccode class=\"type\"\u003ebigserial\u003c/code\u003e）创建的列，它是为该 serial 列定义创建的序列。在后一种情况下，可以使用\u003ccode class=\"command\"\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e修改或删除关联。（这个函数可能应该被称为\u003ccode class=\"function\"\u003epg_get_owned_sequence\u003c/code\u003e；它的当前名称反映了它在历史上曾与 serial 类型的列一起使用。）第一个参数是具有可选模式的表名，第二个参数是列名。由于第一个参数可能包含模式名和表名，因此按照通常的SQL规则解析它，这意味着默认情况下它是小写的。第二个参数只是一个列名，按照字面来处理，因此保留了它的大小写。结果经过了适当的格式化，可以传递给序列函数（参见\u003ca href=\"/docs/18/functions-sequence.html\" title=\"9.17. 序列操作函数\"\u003e第 9.17 节\u003c/a\u003e）。","returns":"text","text":"pg_get_serial_sequence ( table text, column text ) → text","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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":"99cd22cf85a2da97670ebc1222ba44865e97ea82e673761eba7ce8e37d31d156","Text":"pg_get_serial_sequence ( table text, column text ) → text","Returns":"text","Payload":{"description":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (serial, smallserial, bigserial), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with ALTER SEQUENCE OWNED BY. (This function probably should have been called pg_get_owned_sequence; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see Section 9.17).","description_html":"Returns the name of the sequence associated with a column, or NULL if no sequence is associated with the column. If the column is an identity column, the associated sequence is the sequence internally created for that column. For columns created using one of the serial types (\u003ccode class=\"type\"\u003eserial\u003c/code\u003e, \u003ccode class=\"type\"\u003esmallserial\u003c/code\u003e, \u003ccode class=\"type\"\u003ebigserial\u003c/code\u003e), it is the sequence created for that serial column definition. In the latter case, the association can be modified or removed with \u003ccode class=\"command\"\u003eALTER SEQUENCE OWNED BY\u003c/code\u003e. (This function probably should have been called \u003ccode class=\"function\"\u003epg_get_owned_sequence\u003c/code\u003e; its current name reflects the fact that it has historically been used with serial-type columns.) The first parameter is a table name with optional schema, and the second parameter is a column name. Because the first parameter potentially contains both schema and table names, it is parsed per usual SQL rules, meaning it is lower-cased by default. The second parameter, being just a column name, is treated literally and so has its case preserved. The result is suitably formatted for passing to the sequence functions (see \u003ca href=\"/docs/18/functions-sequence.html\" title=\"9.17. Sequence Manipulation Functions\"\u003eSection 9.17\u003c/a\u003e).","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epg_get_serial_sequence\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003etable\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e, \u003cem class=\"parameter\"\u003e\u003ccode\u003ecolumn\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003etext\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003etext\u003c/code\u003e","returns":"text","text":"pg_get_serial_sequence ( table text, column text ) → text","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
