I have a Postgresql function with dynamic query. In that query i have to pass a list into the IN() or ANY() as argument. It works fine when it have value in the passing list. But when the list is empty it is throwing an error.
Query:
query := 'SELECT * FROM TABLE_NAME WHERE uri IN ('|| UIRIS ||')';
error:
ERROR: syntax error at or near ")"
LINE 4: WHERE uri IN()
Is there a way i can handle empty values in IN() or ANY()?