~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/spi/insert_username.example

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;
 
21