Guest User

Untitled

a guest
Jan 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. CREATE TABLE foo
  2. (name TEXT,
  3. sql_type regtype);
  4.  
  5. INSERT INTO foo
  6. VALUES('my_field_1', 'character varying'::regtype);
  7.  
  8. INSERT INTO foo
  9. VALUES('my_field_2', 'VARCHAR(50)'::regtype);
  10.  
  11. INSERT INTO foo
  12. VALUES('my_field_3', 'NUMERIC(32,16)'::regtype);
  13.  
  14. SELECT * from foo;
  15.  
  16. name sql_type
  17. text regtype
  18. -------------------------------------
  19. my_field_1 character varying
  20. my_field_2 character varying
  21. my_field_3 numeric
  22.  
  23. name sql_type
  24. text regtype
  25. -------------------------------------
  26. my_field_1 character varying <-- I won't need such cases
  27. my_field_2 character varying(50)
  28. my_field_3 numeric(32,16)
Add Comment
Please, Sign In to add comment