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

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: AK <alkuzo(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: why semicolon after begin is not allowed in postgresql?
Date: 2013-11-22 22:34:22
Message-ID: 528FDBEE.9050402@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/22/2013 02:24 PM, AK wrote:
> I am reading the following in the documentation: "Tip: A common mistake is to
> write a semicolon immediately after BEGIN. This is incorrect and will result
> in a syntax error."
>
> So, "common mistake" means semicolons after BEGIN seem consistent to many
> people - it seems consistent to me as well. If PostgreSql allowed them, we
> would have one less rule to memorize, shorter documentation, less mistakes
> and so on. In other words, without this limitation PostgreSql would be
> slightly more useful, right?

In Postgresql it is allowed:

test=> BEGIN ;
BEGIN

In plpgsql it is not, which is where you got the above documentation.
That is because SQL BEGIN != plpgsql BEGIN

>
> What am I missing? Why do we need this rule? How is it making PostgreSql
> better?
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/why-semicolon-after-begin-is-not-allowed-in-postgresql-tp5779905.html
> Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2013-11-22 22:38:51 Re: why semicolon after begin is not allowed in postgresql?
Previous Message Mike Blackwell 2013-11-22 22:34:18 Re: why semicolon after begin is not allowed in postgresql?