© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
link

array_to_string(text[]) does not exist.

Can someone help me get this function working?

create or replace FUNCTION getproductswithtags(tags text[] DEFAULT string_to_array('test', 'test2'))
returns setof public.products
as $$
begin
  SELECT product.id, product.name, product.status
  FROM product_tag
  JOIN public.products as product ON product.id = product_tag.product
  WHERE product_tag.tag in (array_to_string(getproductswithtags.tags))
  GROUP BY product.id;
end;
$$ language plpgsql;
create or replace FUNCTION getproductswithtags(tags text[] DEFAULT string_to_array('test', 'test2'))
returns setof public.products
as $$
begin
  SELECT product.id, product.name, product.status
  FROM product_tag
  JOIN public.products as product ON product.id = product_tag.product
  WHERE product_tag.tag in (array_to_string(getproductswithtags.tags))
  GROUP BY product.id;
end;
$$ language plpgsql;

I get array_to_string(text[]) does not exist.
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

operator does not exist uuid = text
SupabaseSSupabase / help-and-questions
4y ago
Struggling to insert string into text array
SupabaseSSupabase / help-and-questions
3y ago
Cannot call pg expression JSON_ARRAY. Does not exist
SupabaseSSupabase / help-and-questions
14mo ago
relation does not exist
SupabaseSSupabase / help-and-questions
4y ago