This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.


Welcome To openGauss Community
Hey @cloudsbreak , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
Contact Guide
If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zhangzq131, @zjh_hw .





测试类型
SQL功能
测试版本
7.0.0LTS
问题描述
B 模式库中,GENERATED AS IDENTITY 列与 ON UPDATE CURRENT_TIMESTAMP 共存时,应报错但静默放行。
PostgreSQL 17.4 实测:ON UPDATE CURRENT_TIMESTAMP 报 syntax error(PG 无此语法)。
openGauss B 库实测:建表成功,ON UPDATE 子句被偷换为 b_db_statement_startup_time(),UPDATE 后 identity 值被重生成(违反 identity 值稳定语义)。
操作系统和硬件信息
数据库版本: openGauss 7.0.0-LTS
测试环境
企业版单机
被测功能
GENERATED AS IDENTITY
预置条件
操作步骤
-- 需在 B 模式库执行
DROP TABLE IF EXISTS t_identity_onupdate CASCADE;
CREATE TABLE t_identity_onupdate(a int GENERATED ALWAYS AS IDENTITY ON UPDATE CURRENT_TIMESTAMP, b int);
-- 建表成功(预期应报错)
INSERT INTO t_identity_onupdate(b) VALUES(1);
SELECT a FROM t_identity_onupdate;
-- a = 1
UPDATE t_identity_onupdate SET b = 2;
SELECT a FROM t_identity_onupdate;
-- a = 2(identity 值被重生成,违反稳定语义)
预期输出
建表时报 syntax error(PostgreSQL 行为)
-- PostgreSQL 17.4 实测
CREATE TABLE t_identity_onupdate(a int GENERATED ALWAYS AS IDENTITY ON UPDATE CURRENT_TIMESTAMP, b int);
-- ERROR: syntax error at or near "ON"
实际输出
建表成功,UPDATE 后 identity 值从 1 变为 2
日志信息
建表成功,UPDATE 后 identity 值从 1 变为 2
提单组织
联合伙伴
测试代码