Bom dia.
Uma dúvida com a uma funcion:
CREATE OR REPLACE FUNCTION padrao.moeda_d
(
  nid  integer
)
RETURNS boolean AS
$$
begin
    if (nid is not null) then
        savepoint p1;

            delete from padrao.moeda
                where padrao.moeda.id = nid;

       rollback to p1;

        update padrao.moeda set
            ativo = 0,
            datalt = now()
        where id = nid;

    end if;

    RETURN TRUE;

exception
    when others then
        RETURN false;
end;
$$
LANGUAGE 'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100;

Ela sempre retorna false, quando passa pelo update da exception, alguma
sugestão de como fazer corretamente ?
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a