-- 获取自增列的名称 SELECT pg_get_serial_sequence('<your_table>', 'id')) AS sequence_name; --获取自增列的下一个值: SELECT nextval(pg_get_serial_sequence('<your_table>', 'id')) AS new_id; --设置自增列的下一个值: select setval(pg_get_serial_sequence('<your_table>', 'id'),1,false);