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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: andrew5(at)ece(dot)cmu(dot)edu, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in ecpg
Date: 2006-02-03 03:55:23
Message-ID: 200602030355.k133tNw00862@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-interfaces pgsql-patches

Andrew Dunstan wrote:
> On Wed, 2006-02-01 at 23:48 -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.
> >
>
> As a matter of curiosity, why does ecpg handle dollar quoting like that?
> psql, for example, happily just passes a dollar quoted string through to
> the backend, without any need to convert it to a conventionally quoted
> string.

ecpg actually parses the statements so it can do things like make
variable substitutions. The $$ and '' strings are actually passed to
preproc.y as SCONST. parser/scan.l does the same thing, though it
doesn't need to single-quote it and pass it up to eventually be output
in C.

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

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Huxton 2006-02-03 08:19:30 Re: BUG #2232: Function (store procedure) prublem
Previous Message Peter Eisentraut 2006-02-02 23:33:24 Re: BUG #2225: Backend crash -- BIG table

Browse pgsql-interfaces by date

  From Date Subject
Next Message Bruce Momjian 2006-02-03 18:55:57 Re: PQfformat() and Composite Formatted Results
Previous Message Andrew Dunstan 2006-02-02 21:45:06 Re: [BUGS] BUG #2171: Differences compiling plpgsql in

Browse pgsql-patches by date

  From Date Subject
Next Message John 2006-02-03 04:04:00 Where to execute the compiled psql
Previous Message Mark Woodward 2006-02-03 03:14:11 Re: Multiple logical databases