Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> But it gets worse. If you create a procedure (no longer a function)
> with a SAVEPOINT and ROLLBACK TO SAVEPOINT, it'll complain about the
> ROLLBACK TO command, but not about SAVEPOINT; and if you remove that,
> then it'll fail at runtime saying that SAVEPOINT is unsupported.
ROLLBACK in plpgsql is a different command with different syntax
options than the core grammar has. So this is a matter of when
syntax errors are detected vs. when semantic errors are detected.
regards, tom lane