yuqi1129 commented on PR #14521:
URL: https://github.com/apache/gravitino/pull/14521#issuecomment-6602508256

   @diqiu50 Thanks for the reproducer. Fixed in 
29d5cc3d0d9a5d140ff02820c448d5283fdc9e11.
   
   Standard non-null `smallserial` / `serial` / `bigserial` columns now use 
`autoIncrement` without carrying the source-owned `nextval(...)` default into 
CREATE. Recreating them produces an independent `GENERATED BY DEFAULT AS 
IDENTITY` sequence. PostgreSQL CREATE and ADD COLUMN also accept smallint 
auto-increment columns.
   
   I would like to keep this fix limited to basic serial/identity value 
generation. The load path verifies both the bare `nextval` expression and its 
dependency on the column-owned sequence. Shared sequence defaults, custom 
expressions and serial columns altered to allow NULL retain their original 
unparsed defaults and remain unsupported for recreation. Sequence state/options 
and `GENERATED ALWAYS` mode are not copied. General expression handling and 
lossless native type/DDL mapping need separate work; expanding this patch to 
cover them would keep adding new edge cases beyond its scope. These limits are 
documented.
   
   Validated the 150-case module unit suite twice, with the 
table/schema-operation fixtures on PostgreSQL 13 and 15 respectively, including 
CREATE/ADD COLUMN round trips and value generation after dropping the source 
table. No failures or skips; reverting the fix makes the targeted 
serial/smallint regressions fail.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to