I'm trying to create a small function that will return all the clients in an array but I keep bumping into errors.
DO $$
DECLARE
c_ids INTEGER[] := array[12879,16759];
BEGIN
SELECT *
FROM client
WHERE id IN (c_ids);
END $$;
What would be the right way to do something like this? I need the c_ids to be a variable because I will be using it in many places in the query (the sample straight forward query is not the end query).