On 09.07.2015 17:23, David G. Johnston wrote:
Sorry for top-post.
It is sad but constructor function for composite type doesn't work in declare block. For example:
CREATE OR REPLACE FUNCTION new_lexema()
RETURNS lexema AS $body$
DECLARE
lex lexema;
BEGIN
lex=ROW ('tt',0);
RETURN lex;
END;
$body$
LANGUAGE PLPGSQL
SECURITY DEFINER;
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();
--
Alex Ignatov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
| This email has been checked for viruses by Avast antivirus software. www.avast.com |