pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Olbersen <DOlbersen@stbernard.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Line length in pl/pgsql function
Date: Wed, 17 Mar 2004 15:03:01 -0500
Message-ID: <27364.1079553781@sss.pgh.pa.us> (raw)
In-Reply-To: <E7E213858379814A9AE48CA6754F5ECB0D74A4@mail01.stbernard.com>
References: <E7E213858379814A9AE48CA6754F5ECB0D74A4@mail01.stbernard.com>

"David Olbersen" <DOlbersen@stbernard.com> writes:
> The errors from psql are attached as psql-errors.txt
> The file with the function is attached as =
> test_ratedby_category_lang.plsql
> The postgresql.conf and current postmaster.opts are attached as well.

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.

This'll all get a *lot* easier in 7.5 when you can use dollar-quoting
instead of having to double quote marks in function bodies ...

			regards, tom lane

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:                                                   ^



view thread (8+ messages)  latest in thread

Message-ID: <27364.1079553781@sss.pgh.pa.us>
Permalink:  ../27364.1079553781@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27364.1079553781@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, DOlbersen@stbernard.com
  Subject: Re: Line length in pl/pgsql function
  In-Reply-To: <27364.1079553781@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox