Re: Psycgop1 vs Psycopg2

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Richard Harley <raharley0(at)googlemail(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Psycgop1 vs Psycopg2
Date: 2011-01-13 18:15:54
Message-ID: AANLkTinwnyH0BfZ1ALTipeyHiYt5mmsLb44wDqez-Wxm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Thu, Jan 13, 2011 at 5:37 PM, Richard Harley
<raharley0(at)googlemail(dot)com> wrote:
> Hello all
>
> I've noticed Psycopg2 handles escaping backslashes differently to
> Psycopg1. Currently we use psycopg1 in a large school registration
> system which uses a lot of these (think AM / PM \). I think the DA is
> sending them though to postgres as \\. But psycopg2 is escaping the next
> character - ('a','b','c','/<----) causing issues. On one hand I want to
> upgrade to psycopg2 because I know 1 is getting on a bit now...but it
> works for the job. Do I need to be overly concerned about how old
> Psycopg1 is now? Is upgrading to 2 going to be worth the headache?

Hi,

I'm not getting exactly what is the escaped character causing
problems: could you send a more detailed example? The query and
arguments you are executing, what are you expecting to receive on the
postgres side and what you are really receiving (it may be handy to
bump the PG logging level to log all the statements fora while in
order to obtain these informations). I am not really expecting the
escaped version of the query to be used for anything else but for the
database to run it, so your report surprises me.

Also, what postgres version are you using? Escaping rules are
different according to the standard_conforming_string setting and
whether your PG version supports it.

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2011-01-14 01:27:01 Re: Please help fixing a couple of zope-related issues
Previous Message Richard Harley 2011-01-13 17:37:12 Psycgop1 vs Psycopg2