Re: Strange DOMAIN behavior

Поиск
Список
Период
Сортировка
От Alex Ignatov
Тема Re: Strange DOMAIN behavior
Дата
Msg-id 559EAF3B.9070900@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Strange DOMAIN behavior  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql


On 09.07.2015 19:50, David G. Johnston wrote:
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.

Thats sad =(. But it is not so gracefully to initialize composite type in the begin block as it would be in declare block %).
Thank you for yours answers!
-- 
Alex Ignatov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company




Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com


В списке pgsql-sql по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Strange DOMAIN behavior
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: How to insert a carriage return and line field between fields in a query