Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shistorian=> create type occurrence_type as enum ('modbus-read', 'user click');
- CREATE TYPE
- shistorian=> create table things (id serial, name varchar, what occurrence_type);
- CREATE TABLE
- shistorian=> insert into things values (1, 'uh oh', 'user click');
- INSERT 0 1
- shistorian=> select * from things;
- id | name | what
- ----+-------+------------
- 1 | uh oh | user click
- (1 row)
- shistorian=> insert into things values (2, 'yay', 'modbus-read');
- INSERT 0 1
- shistorian=> select * from things;
- id | name | what
- ----+-------+-------------
- 1 | uh oh | user click
- 2 | yay | modbus-read
- (2 rows)
- shistorian=> insert into things values (2, 'yay', 'modbus-read22222');
- ERROR: invalid input value for enum occurrence_type: "modbus-read22222"
- LINE 1: insert into things values (2, 'yay', 'modbus-read22222');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement