SupabaseS
Supabase4y ago
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;

I get array_to_string(text[]) does not exist.
Was this page helpful?