pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: andrew5@ece.cmu.edu, PostgreSQL-patches <pgsql-patches@postgresql.org>
Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in ecpg
Date: Thu, 2 Feb 2006 22:55:23 -0500 (EST)
Message-ID: <200602030355.k133tNw00862@candle.pha.pa.us> (raw)
In-Reply-To: <1138905401.5342.15.camel@swithin>

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@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: <200602030355.k133tNw00862@candle.pha.pa.us>
Permalink:  ../200602030355.k133tNw00862@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200602030355.k133tNw00862@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, andrew@dunslane.net, pgsql-patches@postgresql.org
  Subject: Re: [BUGS] BUG #2171: Differences compiling plpgsql in ecpg
  In-Reply-To: <200602030355.k133tNw00862@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