Re: Strange DOMAIN behavior - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Strange DOMAIN behavior
Date
Msg-id CAKFQuwZcGygkNLQewcO-YhyMkgwax8WY9-z_4bkomZHOCp28_g@mail.gmail.com
Whole thread Raw
In response to Re: Strange DOMAIN behavior  (Alex Ignatov <a.ignatov@postgrespro.ru>)
Responses Re: Strange DOMAIN behavior
List pgsql-sql
On Thu, Jul 9, 2015 at 12:42 PM, Alex Ignatov <a.ignatov@postgrespro.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.

pgsql-sql by date:

Previous
From: Alex Ignatov
Date:
Subject: Re: Strange DOMAIN behavior
Next
From: Alex Ignatov
Date:
Subject: Re: Strange DOMAIN behavior