-- Get all unique tags from the blog_posts table SELECT DISTINCT unnest(tags) as tag FROM blog_posts WHERE tags IS NOT NULL AND array_length(tags, 1) > 0 ORDER BY tag;