[PyGreSQL] How to quote strings contain single quote and "$$$$"?

Marina Olhovsky gingerbraid at yahoo.com
Mon Dec 17 08:02:31 EST 2007


Hi Xiao,
   
  Perhaps you could try using Python's string "replace" method to eliminate special characters from your input before inserting it into the database?
   
  Marina.

"fdu.xiaojf at gmail.com" <fdu.xiaojf at gmail.com> wrote:
  Hi all,

I'm a newbie to postgresql. I'm trying to extract data from a MDL sdf file and 
deposit them to my database. Some data item in sdf contains single quote(\') 
or four dollars($$$$) which denotes the end of a record in sdf file.

I use the python interface pgdb to do this, and I have googled and tried 
several ways to quote the string but no success. There is a function 
"escape_string" in the classic python interface pg, but not in pgdb.

Would someone tell me how to solve this problem ?

Thanks a lot.

Xiao Jianfeng
_______________________________________________
PyGreSQL mailing list
PyGreSQL at Vex.Net
http://mailman.vex.net/mailman/listinfo/pygresql


       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.vex.net/pipermail/pygresql/attachments/20071217/febf5d18/attachment.htm 


More information about the PyGreSQL mailing list