X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 957C69DCAB2; Mon, 6 Feb 2006 21:40:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99994-09; Mon, 6 Feb 2006 21:40:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 7BF0C9DCA8E; Mon, 6 Feb 2006 21:40:08 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k171eIY00569; Mon, 6 Feb 2006 20:40:18 -0500 (EST) From: Bruce Momjian Message-Id: <200602070140.k171eIY00569@candle.pha.pa.us> Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in In-Reply-To: <20060206203316.GA9025@1> To: Michael Meskes Date: Mon, 6 Feb 2006 20:40:18 -0500 (EST) CC: andrew5@ece.cmu.edu, PostgreSQL-patches , PostgreSQL-interfaces X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.127 required=5 tests=[AWL=0.127] X-Spam-Score: 0.127 X-Spam-Level: X-Archive-Number: 200602/19 X-Sequence-Number: 5983 Michael Meskes wrote: > On Wed, Feb 01, 2006 at 11:48:45PM -0500, Bruce Momjian wrote: > > I have researched your report, and you are right, there are two ecpg > > bugs here. First, dollar quoting uses single-quotes internally to do > > the quoting, but it does not double any single-quotes in the > > dollar-quoted string. > > Actually ecpg should not translate dollar quoting at all. I'm going to > fix this. Dollar quotes will then be send to the backend with > translation and the backend takes care of the rest. Well, CVS version before I modified it had "dolq" stuff in the lexer to handle dollar quotes and pass it as SCONST to the parser. > > Second, when a dollar quoted string or single-quoted string spans > > multiple lines, ecpg does not escape the newline that is part of the > > string. Some compilers will accept an unescaped newline in a string, > > while others will not: > > Not sure, but there appears to be a bug in the routine that outputs a > statement. I will change that one as well and would ask you to just > check again. It seems to me that this also fixes your problem. I tried > with the one test case in this email and it seems to work. But then I'm > currently travelling and do not have that much spare time to test. The problem is that output.c does: printf("abc def"); While some compilers are OK with that, others are not. I changed it to output: printf("abc\n\ def"); -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073