Re: Escaping input from COPY

Поиск
Список
Период
Сортировка
От Josh Kupershmidt
Тема Re: Escaping input from COPY
Дата
Msg-id CAK3UJRHef9rphY=wx0OhW-LPMQWWGxV7NQY-o2m+6_m+DopzAg@mail.gmail.com
обсуждение исходный текст
Ответ на Escaping input from COPY  (Roger Leigh <rleigh@codelibre.net>)
Ответы Re: Escaping input from COPY
Список pgsql-general
On Mon, Dec 19, 2011 at 6:56 AM, Roger Leigh <rleigh@codelibre.net> wrote:

> I'd like to switch to COPY, which should be orders of
> magnitude faster.  I see that DBD::Pg has an interface for
> this, which looks just fine.  My problem is with how to
> escape the data.  I need to use whatever escaping rules
> are in use by the server, which I've seen documented in
> the manual; but in order to cope with any future changes
> to these rules, and ensure identical behaviour, are there
> any standard functions I can use to escape the data before
> loading it?

This is really a question for the DBD::Pg folks, I think. Looking at:
  http://search.cpan.org/~turnstep/DBD-Pg-2.16.1/Pg.pm#COPY_support

It doesn't look like there is support for escaping COPY data. But
incidentally, I recently brought up the same problem with psycopg2 on
the psycopg list, and it seems there's no existing solution there,
either. Going out on a limb, I'm guessing that connectors don't offer
this support because there is no function in libpq for them to wrap,
and they don't want to kludge their own.

Anyone else think it might be a good idea for libpq to offer some
function to escape text to be used by COPY?

Josh

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

Предыдущее
От: Chris Travers
Дата:
Сообщение: Re: Postgres Logs question
Следующее
От: Culley Harrelson
Дата:
Сообщение: design help for performance