[Zope] Re: [Psycopg] \'s in ZSQL methods with Postgresql

Michele Comitini mcm@mixadlive.com
Sun, 6 May 2001 16:04:32 +0200


--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

To fix the problem Connection.sql_quote__() needed to be overridden with
a version handling "\" escaping correctly.

The latest version on the cvs server (see
http://www.initd.org/Software/psycopg/ on how to use it) should be
correct.  Otherwise you can wait next release which Federico will make
available soon.

Regards,
michele


On Fri, May 04, 2001 at 04:49:24PM +0100, Mayers, Philip J wrote:
> Ok, thanks.
>=20
> Regards,
> Phil
>=20
> +----------------------------------+
> | Phil Mayers, Network Support     |
> | Centre for Computing Services    |
> | Imperial College                 |
> +----------------------------------+ =20
>=20
> -----Original Message-----
> From: Federico Di Gregorio [mailto:fog@mixadlive.com]
> Sent: 04 May 2001 16:05
> To: Mayers, Philip J
> Cc: 'psycopg@lists.initd.org'; 'zope@zope.org'
> Subject: Re: [Psycopg] \'s in ZSQL methods with Postgresql
>=20
>=20
> Scavenging the mail folder uncovered Mayers, Philip J's letter:
> > This:
> >=20
> > update tb1 set cl1=3D<dtml-sqlvar val1 type=3Dnb>,who=3D<dtml-sqlvar
> > "REQUEST.AUTHENTICATED_USER">,time=3Dnow()
> >=20
> > Called with:
> >=20
> > sqlmethod(val1=3D'\')
> >=20
> > Fails with:
> >=20
> > Error Type: ProgrammingError
> > Error Value: ERROR: parser: parse error at or near "loginname" update t=
b1
> > set cl1=3D'\',who=3D'loginname',time=3Dnow()
> >=20
> > Clearly the \ needs to be escaped. Is this Postgres specific? If so, why
> > isn't the DA (ZPsycopg) quoting it? Running Zope 2.3.2
>=20
> you are right, quoting will be fixed in the next release (we use psycopg
> much more than ZPsycopgDA, so this one still has some rought edges...)
> btw, what does 'type=3Dnb' means? (i only know of string and int...)
>=20
> ciao,
> federico
>=20
> --=20
> Federico Di Gregorio
> MIXAD LIVE Chief of Research & Technology              fog@mixadlive.com
> Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
>   Try the Joy of TeX [http://www.tug.org]
>                                       -- brought to you by One Line Spam
> _______________________________________________
> Psycopg mailing list
> Psycopg@lists.initd.org
> http://lists.initd.org/cgi-bin/mailman/listinfo/psycopg

--82I3+IH0IqGh5yIs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE69VnwHygWwn5gTsIRAsWhAJ46gqi1O9Qii7dwqzaX56gKOIGChQCgz/I0
qMwQxLvTmqqn6OI+X216R20=
=sXWM
-----END PGP SIGNATURE-----

--82I3+IH0IqGh5yIs--