From: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
---|---|
To: | Mike Blackwell <mike(dot)blackwell(at)rrd(dot)com> |
Cc: | AK <alkuzo(at)gmail(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: why semicolon after begin is not allowed in postgresql? |
Date: | 2013-11-22 22:38:51 |
Message-ID: | CAHyXU0y1XK+eJTUxUWQBREDH6_4-gd0brY0E9XZ9LJXW6Dc+fg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Nov 22, 2013 at 4:34 PM, Mike Blackwell <mike(dot)blackwell(at)rrd(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Kevin Grittner | 2013-11-22 22:43:06 | Re: why semicolon after begin is not allowed in postgresql? |
Previous Message | Adrian Klaver | 2013-11-22 22:34:22 | Re: why semicolon after begin is not allowed in postgresql? |