Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. CREATE TABLE array_test (
  2. text_column TEXT []
  3. );
  4.  
  5. INSERT INTO array_test (text_column) VALUES (ARRAY ['test']), (ARRAY [NULL]), (ARRAY [NULL, 'test']);
  6.  
  7. UPDATE array_test
  8. SET text_column = (SELECT array_agg(x)
  9. FROM unnest(text_column) x
  10. WHERE x IS NOT NULL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement