Re: copy with escape

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: copy with escape
Дата
Msg-id 22522.1203995233@sss.pgh.pa.us
обсуждение исходный текст
Ответ на copy with escape  ("blackwater dev" <blackwaterdev@gmail.com>)
Список pgsql-general
"blackwater dev" <blackwaterdev@gmail.com> writes:
> I have data that I'm running through pg_escape_sting in php and then adding
> to stdin for a copy command.  The problem is "O'reilly" is being changed to
> "O''Reilly" in the string and then in the db.

pg_escape_string is designed to produce a string properly quoted for use
as a literal in a SQL command.  It is completely wrong for data that is
to go into COPY input.  I kinda doubt that PHP has anything built-in
that's suitable for COPY, though I could be wrong ...

            regards, tom lane

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

Предыдущее
От: "blackwater dev"
Дата:
Сообщение: copy with escape
Следующее
От: brian
Дата:
Сообщение: Re: copy with escape