PostgreSQL uses sequences to generate values for serial columns and serial columns are generally what is used for "auto-incrementing" columns in PostgreSQL. Sequences have names and are, in general, independent of any particular table so you cou…
create sequence SEQ_ID minvalue 1 maxvalue 99999999 start with 1 increment by 1 nocache order; 建解发器代码为: create or replace trigger tri_test_id before insert on test --S_Depart 是表名 for each row declare nextid number; begin IF :new.id IS NULL or :new.id…