Re: RPM question: Where to put psycopg2 files - Mailing list psycopg

From Karsten Hilbert
Subject Re: RPM question: Where to put psycopg2 files
Date
Msg-id 20110117161614.GE2576@hermes.hilbert.loc
Whole thread Raw
In response to Re: RPM question: Where to put psycopg2 files  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
On Mon, Jan 17, 2011 at 01:35:38PM +0000, Daniele Varrazzo wrote:

> >> You don't need that, because psycopg uses libpq that can connect to
> >> older versions of the backend.
> >>
> >> I don't know about RPMs but in Debian we have multiple versions of
> >> postgresql and only *one* libpqXX package (usually it comes from the
> >> most recent stable release). So my suggestion is to have only one
> >> version of psycopg linked to the most recent libpq package.
> >
> > This is not really the final solution.
> >
> > I've got a Debian/Squeeze machine which runs PG 9.0 from /Unstable.
> >
> > I've got a second Debian/Squeeze machine running PG 8.4 from /Squeeze.
> >
> > Both use the same psycopg2 from /Squeeze.
> >
> > Transferring bytea data from the 9.0 machine to the 8.4 one
> > does not work (other datatypes work fine).
>
> Using a psycopg with libpq < 9 to talk with postgres >= 9 yes, there
> is this problem. The other way around it works fine: psycopg+libpq 9
> passes all the tests even with a 7.4 server.
>
> The problem is that postgres 9 uses by default the hex format instead
> of the escape format to represent bytea
> (http://www.postgresql.org/docs/9.0/static/datatype-binary.html).

Aha. I missed that.

> A workaround I was thinking about could be to send "SET bytea_output TO
> 'escape';" on connection

I fixed my client to issue that query on new connections.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: RPM question: Where to put psycopg2 files
Next
From: Karsten Hilbert
Date:
Subject: Re: RPM question: Where to put psycopg2 files