alex-hhh/emacs-sql-indent

`BEGIN' block never ends unless optional keywords are used

Closed this issue · 0 comments

ieure commented

The following code doesn't indent properly:

BEGIN;
  SELECT * FROM foo;
  COMMIT;

It works if you provide the TRANSACTION keyword:

BEGIN TRANSACTION;
SELECT * FROM foo;
COMMIT;

I'm not sure what the standard says, but my experience has been that BEGIN; is much more commonly used than BEGIN TRANSACTION;. PostgreSQL also allows BEGIN WORK, which exhibits the same problem.