Re: Strange DOMAIN behavior

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alex Ignatov <a(dot)ignatov(at)postgrespro(dot)ru>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Strange DOMAIN behavior
Date: 2015-07-09 16:50:53
Message-ID: CAKFQuwZcGygkNLQewcO-YhyMkgwax8WY9-z_4bkomZHOCp28_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alex Ignatov 2015-07-09 17:28:27 Re: Strange DOMAIN behavior
Previous Message Alex Ignatov 2015-07-09 16:42:24 Re: Strange DOMAIN behavior