Debian Codegraph @

contrib/spi/insert_username.example

raw
1 DROP TABLE username_test;
2
3 CREATE TABLE username_test (
4 name text,
5 username text not null
6 );
7
8 CREATE TRIGGER insert_usernames
9 BEFORE INSERT OR UPDATE ON username_test
10 FOR EACH ROW
11 EXECUTE PROCEDURE insert_username (username);
12
13 INSERT INTO username_test VALUES ('nothing');
14 INSERT INTO username_test VALUES ('null', null);
15 INSERT INTO username_test VALUES ('empty string', '');
16 INSERT INTO username_test VALUES ('space', ' ');
17 INSERT INTO username_test VALUES ('tab', ' ');
18 INSERT INTO username_test VALUES ('name', 'name');
19
20 SELECT * FROM username_test;