Re: pg_escape with copy

From: Date: Wed, 27 Feb 2008 00:20:16 +0000
Subject: Re: pg_escape with copy
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44667@lists.php.net to get a copy of this message
blackwater dev wrote:
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. I saw with the copy command I can specify the escape but it isn't working for me. Should this command fix this double 'single' quote issue when I put it in the db? And what is the proper syntax?
AFAIK "copy" takes the csv file and imports it (and handles quotes etc itself). So just create your file: First Name, Last Name Tim, O'Reilly and when you "copy" that in (without the header line), it'll "just work". -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#44667) next »