Re: Why does the PL/pgSQL compiler do this?
От | Michael Moore |
---|---|
Тема | Re: Why does the PL/pgSQL compiler do this? |
Дата | |
Msg-id | CACpWLjOVudD-7JEVu=u4UUMWLQeAoQzfAiPwj9xjPnBqWHxKnw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Why does the PL/pgSQL compiler do this? ("David G. Johnston" <david.g.johnston@gmail.com>) |
Ответы |
Re: Why does the PL/pgSQL compiler do this?
|
Список | pgsql-sql |
Cool, thanks David, I'll give it a read.
On Mon, Oct 31, 2016 at 3:24 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
Here is the complete function, but all you need to look at is the exception block. (I didn't write this code) :-) I will ask the question after the code.[...]RETURN TRUE;
EXCEPTION WHEN OTHERS THEN
RAISE EXCEPTION '% %', SQLERRM, SQLSTATE;
ROLLBACK;
RETURN FALSE;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
So, here is the question. Why does the compiler not catch:
1) ROLLBACK; is not a valid PL/pgSQL command
Reading section 41.10.2 at the linked page should answer this part.2) ROLLBACK; and RETURN FALSE; can never be reached
Similar to the above - though "static analysis" is yet a step beyond even what the syntax checking skipping covered above would reveal.David J.
В списке pgsql-sql по дате отправления: