Re: why semicolon after begin is not allowed in postgresql? - Mailing list pgsql-hackers

From David Johnston
Subject Re: why semicolon after begin is not allowed in postgresql?
Date
Msg-id 1385413692171-5780222.post@n5.nabble.com
Whole thread Raw
In response to Re: why semicolon after begin is not allowed in postgresql?  (AK <alkuzo@gmail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Put json type into alphabetical order in manual table
Next
From: Andres Freund
Date:
Subject: Re: Errors on missing pg_subtrans/ files with 9.3