From: Christian T. <ct...@go...> - 2002-03-04 08:21:34
|
Hi. This is a question that *should* be only postgres specific, but i don't know exactly: THe only special character i can think of having troubles beeing inserted is - as you showed down in your dictionary example, the ' quote, which you should escape with a double ' ('') because postgres uses ' to start and finish strings. hope that helps ... christian. On Sun, Mar 03, 2002 at 08:26:06PM -0800, Aleksandar Kacanski wrote: > I work with the pypgsql and love the library. It is very > well designed peace of code and works extremely well for > me. > However I have question that I need help with. > I am designing web interface in python to accommodate > automation of the product database. > Everything works flawlessly, but special characters will > not pass in the insert SQL statement. > how should I handle case when I have special chars included > into value text or character varying. > I would pool something like this: dict = {'key':"value's"} > which will get me error back. > do I need to deal with the special chars prior to adding > values to execute statement, or I am missing something on > the design of the table - fields > > Please send response to kac...@ya... > > Thanks -- Christian Theune - ct...@go... gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981 reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b']) |