Re: Adjusting a mode function for the deprecation of anyarray

2023-01-15 Thread Aditya Toshniwal
Hi Wells, This is a pgAdmin mailing list. You will get better support on PostgreSQL mailing list - pgsql-ad...@postgresql.org. On Sun, Jan 15, 2023 at 2:45 AM Wells Oliver wrote: > We have had and used this basic dumb useful aggregate in PG 13 and earlier: > > CREATE OR REPLACE FUNCTION _final_

Adjusting a mode function for the deprecation of anyarray

2023-01-14 Thread Wells Oliver
We have had and used this basic dumb useful aggregate in PG 13 and earlier: CREATE OR REPLACE FUNCTION _final_mode(anyarray) RETURNS anyelement AS $BODY$ SELECT a FROM unnest($1) a GROUP BY 1 ORDER BY COUNT(1) DESC, 1 LIMIT 1; $BODY$ LANGUAGE sql IMMUTABLE; CREATE AGGREGATE