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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [BUGS] BUG #2171: Differences compiling plpgsql in ecpg
Дата
Msg-id 200602030355.k133tNw00862@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #2171: Differences compiling plpgsql in  (Andrew Dunstan <andrew@dunslane.net>)
Список 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@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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: pg_restore COPY error handling
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #2171: Differences compiling plpgsql in ecpg and psql