I'm selecting rows from a table where the id is in an array. This works, but I also want to return default values for rows that do not exist in the table.
I currently have
SELECT
id,
column1
FROM
table_name
WHERE
id = ANY(ids_array_variable)
but, if some of the ids in the array do not exist in the table, then my result is short a few rows. I need it to still return a default record of {id, default_value} so that the result always has the same number of entries as the ids_array_variable