Re: why semicolon after begin is not allowed in postgresql?

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: why semicolon after begin is not allowed in postgresql?
Date: 2013-11-25 21:08:12
Message-ID: 1385413692171-5780222.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

AK wrote
> Kevin,
>
> I do see your logic now, but this thing is a common mistake - it means
> that this seems counter-intuitive to some people. What would happen if we
> applied Occam's razor and just removed this rule?
>
> All existing code would continue to work as is, and we would have one less
> rule to memorize. That would make PostgreSql a slightly better product,
> right?

I'm somewhat on the fence for this but am leaning toward maintaining
status-quo. Mostly because of the analogy with "IF ... END IF;" versus the
SQL BEGIN; command which is a entirely separate construct.

I would maybe change the documentation so that instead of simply dictating a
rule we explain why the syntax is the way it is - like this thread is doing.
If they consciously omit the semi-colon hopefully they also understand that
what they are beginning is a code-block in plpgsql as opposed to an SQL
transaction.

That said, technical purity isn't always a good answer. I'd be inclined to
let someone passionate enough about the idea implement it an critique
instead of dis-allowing it outright; but in the end that is likely to result
in the same end.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/why-semicolon-after-begin-is-not-allowed-in-postgresql-tp5779905p5780222.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-25 21:11:41 Re: Errors on missing pg_subtrans/ files with 9.3
Previous Message Andreas Karlsson 2013-11-25 21:07:58 Put json type into alphabetical order in manual table