Pessoal estou aprendendo pl/python. Estou fazendo esse exemplo do manual
do postgresql:
CREATE TYPE greeting AS
(how text,
who text);
create or replace function greet (how text)
returns setof greeting
AS $BODY$
return ([how,"World"],[how,"PostgreSQL"])
$BODY$ LANGUAGE plpythonu;
Quando executo Select greet('Ola') ele retorna (Ola,World) e
(Ola,PostgreSQL) certinho.
Agora se eu colocar a funcao dessa forma:
create or replace function greet (how text)
returns setof greeting
AS $BODY$
return ([how,"World"])
$BODY$ LANGUAGE plpythonu;
E executar o mesmo comando "Select greet('Ola')" dá erro :
returned sequence's length must be same as tuple's length
Porque esse erro? Nao pode retornar só uma linha de retorno?
Charles
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral