Alvaro Herrera <alvherre@commandprompt.com> writes:
> tkarlik@ultimo.pl wrote:
>> Without casting function executes much slower:
> If you're looking for a speedy answer, try a SQL function, not plpgsql.
He's still going to need the cast to name. It's not a bug, it's just
how things work: the indexes on pg_class support name = name equality
tests, not text = text.
regards, tom lane