Re: Line length in pl/pgsql function - Mailing list pgsql-sql

From David Olbersen
Subject Re: Line length in pl/pgsql function
Date
Msg-id E7E213858379814A9AE48CA6754F5ECB0D74A6@mail01.stbernard.com
Whole thread Raw
In response to Line length in pl/pgsql function  ("David Olbersen" <DOlbersen@stbernard.com>)
List pgsql-sql
Tom Lane wrote:

> Hate to tell you this, but it's just pilot error.  You've got comments
> like these embedded in the plpgsql function:
>
>             ELSIF cat = ''none'' THEN
>                 -- none,none = don't show the languages, or categories
>                 (whaaat?) FOR result IN
>
> That quote in "don't" has to be doubled.  Remember this whole thing is a
> giant string literal as far as the outer CREATE FUNCTION syntax is
> concerned.  The fact that the quote is within a comment in terms of the
> plpgsql syntax doesn't mean a thing to the outer string-literal parser.

*sigh* I'd rather have pilot error than having to wait for a patch :)

It's funny, I use Vim with syntax highlighting to catch this sort of thing. 99% of the time it does, I guess this is
thatother 1%. 

> PS: note to hackers: Fabien's new error localization code does a pretty
> decent job of fingering the problem.  When I loaded this test file into
> CVS tip I got
>
> psql:test_ratedby_category_lang.plsql:95: ERROR:  syntax error at or near "t"
> at character 3419 psql:test_ratedby_category_lang.plsql:95: LINE 81:
> -- none,everything = don't show the language...
> psql:test_ratedby_category_lang.plsql:95:
> ^

That would have been handy!

--
David Olbersen
iGuard Engineer
St. Bernard Software
15015 Avenue of Sciences
San Diego, CA 92127
x2152


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Line length in pl/pgsql function
Next
From: "David Olbersen"
Date:
Subject: Re: Line length in pl/pgsql function