Friday, August 22, 2014

PostgreSQL: array field

If we have array field in postgresql (like `tags`), we can use it for search as well:

- search records which contain `tag`
`ruby` = ANY(tags)
- search through array with tags
`{ruby, python, java}` && tags
- all tags should be equal `ruby`
`ruby` = ALL(tags)

No comments:

Post a Comment

 
 
Blogger Templates