On Thu, Jul 9, 2015 at 12:42 PM, Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>
wrote:
> DROP FUNCTION lexema_test( );
> CREATE OR REPLACE FUNCTION lexema_test()
>    RETURNS VOID AS $body$
> DECLARE
>    lex lexema :=new_lexema();
> BEGIN
> END;
> $body$
> LANGUAGE PLPGSQL
> SECURITY DEFINER;
>
> Then I got:
> ERROR:  default value for row or record variable is not supported
> LINE 17:    lex lexema :=new_lexema();
>
>
​Undocumented limitation :(
While slightly more verbose you simply need to:
DECLARE lex lexema;
BEGIN
lex := new_lexema();
[...]
David J.