On Mon, Dec 19, 2011 at 6:56 AM, Roger Leigh <rleigh@xxxxxxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general