By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE FUNCTION immutable_concat(VARIADIC anyarray)
RETURNS text
LANGUAGE sql IMMUTABLE PARALLEL SAFE
as $$ select array_to_string($1, '') $$;
select immutable_concat(1,2,3)
,immutable_concat(true,false,false)
,immutable_concat(1e2,.1,9.)
,immutable_concat(now(),'infinity','today allballs')
CREATE FUNCTION
immutable_concat | immutable_concat | immutable_concat | immutable_concat |
---|---|---|---|
123 | tff | 1000.19 | 2025-03-07 15:57:01.208189+00infinity2025-03-07 00:00:00+00 |
SELECT 1
CREATE FUNCTION immutable_concat2(VARIADIC "any")
RETURNS text
LANGUAGE internal IMMUTABLE PARALLEL SAFE
as 'text_concat';
select immutable_concat2(1,'x'::text,false);
CREATE FUNCTION
immutable_concat2 |
---|
1xf |
SELECT 1