Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shistorian=> create type occurrence_type as enum ('modbus-read', 'user click');
  2. CREATE TYPE
  3.  
  4. shistorian=> create table things (id serial, name varchar, what occurrence_type);
  5. CREATE TABLE
  6.  
  7. shistorian=> insert into things values (1, 'uh oh', 'user click');
  8. INSERT 0 1
  9.  
  10. shistorian=> select * from things;
  11.  id | name  |    what    
  12. ----+-------+------------
  13.   1 | uh oh | user click
  14. (1 row)
  15.  
  16. shistorian=> insert into things values (2, 'yay', 'modbus-read');
  17. INSERT 0 1
  18. shistorian=> select * from things;
  19.  id | name  |    what    
  20. ----+-------+-------------
  21.   1 | uh oh | user click
  22.   2 | yay   | modbus-read
  23. (2 rows)
  24.  
  25. shistorian=> insert into things values (2, 'yay', 'modbus-read22222');
  26. ERROR:  invalid input value for enum occurrence_type: "modbus-read22222"
  27. LINE 1: insert into things values (2, 'yay', 'modbus-read22222');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement