uugx_g
Last Updated: February 25, 2016
·
750
· whatupdave
Screen shot 2012 04 30 at 3.00

Get all Postgres array entries in Rails

For example, if you have articles with tags stored in a Postgres array, you can select the unique set of tags like so:

Article.pluck('distinct unnest(tags)')
Say Thanks
Respond