Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLstored procedures functionsSingle-choice MCQ

A polymorphic PL/pgSQL function uses anyelement to accept and return any type. Why does PostgreSQL reject the call SELECT pick(1, 'x');?

CREATE FUNCTION pick(a anyelement, b anyelement) RETURNS anyelement AS $$ BEGIN RETURN a; END; $$ LANGUAGE plpgsql; -- call: SELECT pick(1, 'x');