On Mon, Aug 30, 2021 at 01:47:19PM +0100, Pól Ua Laoínecháin wrote:
> I was just wondering if there is some (already written) function out
> there that will drop this functionality into my lap?
Sure, here:
#v+
create function array_dups(ANYARRAY) returns ANYARRAY as $$
select array( select i from unnest($1) i group by i having count(*) > 1 );
$$ language sql;
#v-
Best regards,
depesz