The point is that with
CREATE FUNCTION you're creating
a function in
SQL context, and not in Tcl's.
To use your newly created function written in pltcl (or written
in any
other PG scripting language) from within pltcl you'll have to
resort to query execution procs, like spi_exec and
friends:
CREATE FUNCTION foo (varchar) RETURNS varchar AS '
spi_exec "select meta_class(''[quote $1]'') as ret_value"
return $ret_value
' LANGUAGE 'pltcl';
Note that since
meta_class expects varchar you'll
need to enclose its argument in single quotes and escape
any single quote contained within its argument appropriately.