X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 17E45D1E90F for ; Wed, 17 Mar 2004 20:03:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 52011-06 for ; Wed, 17 Mar 2004 16:03:02 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 8F30FD1E883 for ; Wed, 17 Mar 2004 16:03:00 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i2HK31FQ027365; Wed, 17 Mar 2004 15:03:01 -0500 (EST) To: "David Olbersen" Cc: pgsql-sql@postgresql.org Subject: Re: Line length in pl/pgsql function In-reply-to: References: Comments: In-reply-to "David Olbersen" message dated "Wed, 17 Mar 2004 11:50:44 -0800" Date: Wed, 17 Mar 2004 15:03:01 -0500 Message-ID: <27364.1079553781@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/188 X-Sequence-Number: 17287 "David Olbersen" 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: ^