From: | "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org> |
---|---|
To: | Adrian Klaver <aklaver(at)comcast(dot)net> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Creating a function with single quotes |
Date: | 2009-02-20 15:02:15 |
Message-ID: | 200902201602.15541.leif@solumslekt.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Friday 20. February 2009, Adrian Klaver wrote:
>On Friday 20 February 2009 6:29:43 am Leif B. Kristensen wrote:
>> About twenty years ago I wrote a lot of Turbo Pascal code, and IIRC
>> semicolon after an END was allowed but considered bad style.
The rules concerning ENDs and semicolons in Pascal were quite more
complex than that. I won't try to make a synopsis here as it's
massively off-topic. These days I prefer languages with curly braces as
block delimiters; however the old Pascal exposure does come back when I
write sprocs in Postgres.
Actually, I believe that the syntax is derived from ALGOL, the
grandmother of all structured languages, rather than Pascal.
>Learned something new. I went and reread the docs and found:
>
>"Each declaration and each statement within a block is terminated by a
>semicolon. A block that appears within another block must have a
> semicolon after END, as shown above; however the final END that
> concludes a function body does not require a semicolon."
>
>I have always seen them terminated with a semicolon and did that
> assuming thing.
«Assumption is the mother of all fuckups» :-)
IMHO, someone should revise the syntax of the example in the document
(http://www.postgresql.org/docs/current/interactive/plpgsql-structure.html)
to state that the semicolon after the final END is not required.
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/
From | Date | Subject | |
---|---|---|---|
Next Message | M.P.Dankoor | 2009-02-20 15:41:22 | Re: How concat 3 strings if 2 are not empty? |
Previous Message | Adrian Klaver | 2009-02-20 14:37:28 | Re: Creating a function with single quotes |