© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
FLovin

How to unpack an array of arrays with an RPC

It seems there's a lot of the documentation that assumes comfort and familiarity with PostgreSQL which makes sense, but for those of us who are being introduced to it for the first time through Supabase, I am having a hard time finding out how to do certain PostgreSQL things the "Supabase way"

For example, I have a situation where I'd like to tag a function parameter that is an array of arrays, and loop through it. Something along the lines of "Each of these arrays I am sending is a family of words, find at least one of these words in each"

['blue', 'red', 'green'] = blue OR red OR green
AND
['house', 'apartment', 'condo'] = house OR apartment OR condo

where a row containing blue AND apartment would work, or green AND condo, but not blue AND green and none of the second array, or vice versa.

Where's a good resource for learning how to craft these? More often than not examples I find online are for different versions of Postgres, take advantage of extensions I don't have, or have some other syntactical weirdness because I am using JSONB and it doesn't seem to want to cast in the same way as the person's example.

Are function parameters even optional? It seems like they aren't (not here, I mean in Postgres at large) and also that something like knowing that an array is empty and skipping it isn't either.

Strongly thinking about going to #jobs just to figure out how to craft certain things.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RPC to add to an array
SupabaseSSupabase / help-and-questions
4y ago
how can I pass an array of objects to an rpc call?
SupabaseSSupabase / help-and-questions
4y ago
SOLVED] How to cast an RPC with array? [FEATURE PROPOSAL]
SupabaseSSupabase / help-and-questions
4y ago
How to query arrays?
SupabaseSSupabase / help-and-questions
4y ago