Skip site navigation (1) Skip section navigation (2)

Re: [BUGS] BUG #2171: Differences compiling plpgsql in

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: andrew5(at)ece(dot)cmu(dot)edu, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, PostgreSQL-interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in
Date: 2006-02-07 01:40:18
Message-ID: 200602070140.k171eIY00569@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-interfacespgsql-patches
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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-bugs by date

Next:From: Matej RizmanDate: 2006-02-07 02:41:03
Subject: BUG #2243: Postgresql fails to finish some queries
Previous:From: James William PyeDate: 2006-02-07 01:22:51
Subject: Re: BUG #2240: length() with geometric types

pgsql-interfaces by date

Next:From: Matson, Sunny (GE Healthcare)Date: 2006-02-07 09:29:46
Subject: ECPG interface issue
Previous:From: Bruce MomjianDate: 2006-02-07 01:24:19
Subject: Re: PQprint under Windows

pgsql-patches by date

Next:From: Christopher Kings-LynneDate: 2006-02-07 02:22:34
Subject: Re: drop if exists remainder
Previous:From: Thomas F. O'ConnellDate: 2006-02-06 23:56:45
Subject: Re: pgbench: Support Multiple Simultaneous Runs (with Mean and Std. Dev.)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group