SELECT array_to_percentiles('{}'::float[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{}'::float[]); array_to_percentiles ---------------------- (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::smallint[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- {1,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::integer[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- {1,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::bigint[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- {1,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::real[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- {1,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{0.2,0.4}'::float[]); array_to_percentiles ---------------------- {1,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::text[], '{0.2,0.4}'::float[]); ERROR: Percentiles subject must be SMALLINT, INTEGER, BIGINT, REAL, or DOUBLE PRECISION values SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{0,0.2}'::float[]); array_to_percentiles ---------------------- {0,1} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{0.2,1}'::float[]); array_to_percentiles ---------------------- {1,7} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{0.5}'::float[]); array_to_percentiles ---------------------- {1.5} (1 row) SELECT array_to_percentiles('{1,2,5,3,0}'::float[], '{0.5}'::float[]); array_to_percentiles ---------------------- {2} (1 row) SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{-0.2,-0.4}'::float[]); ERROR: Percent must be between 0 and 1 SELECT array_to_percentiles('{1,1,5,2,0,7}'::float[], '{1.2}'::float[]); ERROR: Percent must be between 0 and 1