Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgres add prefix to primary key

CREATE TRIGGER test BEFORE INSERT ON name_of_table
FOR EACH ROW SET row_nanme = CONCAT('prefix-', primary_key);
 
PREVIOUS NEXT
Tagged: #postgres #add #prefix #primary #key
ADD COMMENT
Topic
Name
3+2 =