pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Michael Meskes <meskes@postgresql.org>
Cc: andrew5@ece.cmu.edu, PostgreSQL-patches <pgsql-patches@postgresql.org>
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in
Date: Mon, 6 Feb 2006 20:40:18 -0500 (EST)
Message-ID: <200602070140.k171eIY00569@candle.pha.pa.us> (raw)
In-Reply-To: <20060206203316.GA9025@1>

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



view thread (9+ messages)  latest in thread

Message-ID: <200602070140.k171eIY00569@candle.pha.pa.us>
Permalink:  ../200602070140.k171eIY00569@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200602070140.k171eIY00569@candle.pha.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-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, meskes@postgresql.org, pgsql-patches@postgresql.org
  Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in
  In-Reply-To: <200602070140.k171eIY00569@candle.pha.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