SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
DROP TABLE IF EXISTS tr_copy_test CASCADE; --CREATE TABLE tr_copy_test(str text check (length(str)<3)); CREATE TABLE tr_copy_test(str varchar(2)); DROP FUNCTION IF EXISTS f_tr_copy_test; CREATE FUNCTION f_tr_copy_test () RETURNS TRIGGER AS $BODY$ BEGIN NEW.str := 'xz'; RETURN NEW; END; $BODY$ LANGUAGE 'plpgsql'; CREATE TRIGGER trig_tr_copy_test BEFORE INSERT ON tr_copy_test FOR EACH ROW EXECUTE FUNCTION f_tr_copy_test (); INSERT INTO tr_copy_test VALUES ('abcdef'); select * from tr_copy_test;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear