Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: copy with escape



"blackwater dev" <blackwaterdev(at)gmail(dot)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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group