Created
January 19, 2014 20:54
-
-
Save esmevane/8510881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| burrito-tropical=# select * from labels; | |
| id | message_id | account_id | content | created_at | updated_at | |
| -----+------------+------------+--------------------------------+------------+------------ | |
| 441 | | | {1} | | | |
| 442 | | | {Inbox,Unread} | | | |
| 443 | | | {Inbox} | | | |
| 444 | | | {Request,Inbox,Papaya,Burrito} | | | |
| 445 | | | {Request,Inbox,Papaya,Burrito} | | | |
| 446 | | | {Request,Inbox,Papaya,Burrito} | | | |
| 447 | | | {Request,Burrito} | | | |
| (7 rows) | |
| burrito-tropical=# update labels | |
| burrito-tropical-# set content = (select array_agg(x) | |
| burrito-tropical(# from (select unnest(content) as x) sq_1 | |
| burrito-tropical(# where not x = 'Request') | |
| burrito-tropical-# where content @> '{Request}'; | |
| UPDATE 4 | |
| burrito-tropical=# select * from labels; | |
| id | message_id | account_id | content | created_at | updated_at | |
| -----+------------+------------+------------------------+------------+------------ | |
| 441 | | | {1} | | | |
| 442 | | | {Inbox,Unread} | | | |
| 443 | | | {Inbox} | | | |
| 444 | | | {Inbox,Papaya,Burrito} | | | |
| 445 | | | {Inbox,Papaya,Burrito} | | | |
| 446 | | | {Inbox,Papaya,Burrito} | | | |
| 447 | | | {Burrito} | | | |
| (7 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment