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

From Merlin Moncure
Subject Re: why semicolon after begin is not allowed in postgresql?
Date
Msg-id CAHyXU0y1XK+eJTUxUWQBREDH6_4-gd0brY0E9XZ9LJXW6Dc+fg@mail.gmail.com
Whole thread Raw
In response to Re: why semicolon after begin is not allowed in postgresql?  (Mike Blackwell <mike.blackwell@rrd.com>)
List pgsql-hackers
On Fri, Nov 22, 2013 at 4:34 PM, Mike Blackwell <mike.blackwell@rrd.com> wrote:
> I believe the section you are reading refers to the BEGIN keyword in the
> procedural language plpgsql, not the SQL 'BEGIN' command.  The issue stems
> from confusing two distinct languages both of which, along with several more
> procedural languages, are documented in the same manual.

This is inherited constraint from Oracle pl/sql which pl/pgsql is, uh,
inspired by.  In pl/sql, all block opening constructs (THEN, LOOP,
BEGIN) do not get semi-colons.  BEGIN is a weird case because it's
(quite unfortunately) also the same thing that explicitly opens a
transaction in vanilla SQL; you use a semi-colon there as with any
standard SQL statement.

merlin



pgsql-hackers by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: why semicolon after begin is not allowed in postgresql?
Next
From: Kevin Grittner
Date:
Subject: Re: why semicolon after begin is not allowed in postgresql?