Re: RPM question: Where to put psycopg2 files
От | Karsten Hilbert |
---|---|
Тема | Re: RPM question: Where to put psycopg2 files |
Дата | |
Msg-id | 20110117163851.GF2576@hermes.hilbert.loc обсуждение исходный текст |
Ответ на | Re: RPM question: Where to put psycopg2 files (Federico Di Gregorio <federico.digregorio@dndg.it>) |
Список | psycopg |
On Mon, Jan 17, 2011 at 02:53:16PM +0100, Federico Di Gregorio wrote: > On 17/01/2011 14:35, Daniele Varrazzo wrote: > > 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). A > > workaround I was thinking about could be to send "SET bytea_output TO > > 'escape';" on connection in case of pre9-libpq/post9-server > > combination is detected. I hate it because I was trying to drop the > > "queries on connection" psycopg does (there used to be 3, now there is > > only one and I think the last one can be dropped as well). > > Please lets not do that. psycopg can already be used with a lesser libpq > to connect to a newer backend _unless_ changes like the one in this > discussion. Solving this particular problem may seem a good thing but, > IMHO, it is just putting a workaround in the wrong place. > > > Of course > > bytea_output can be set in the postgresql.conf too and it would make > > previous releases of psycopg work fine. > > That's the correct workaround. However, the workaround should be as local as possible such that other, global things stay unchanged. Hence IMO the correct place for adding the workaround is not in the - server (postgresql.conf) - database (alter database set ...) - role (alter role set ...) - adaptor (psycopg2) configuration but rather in the client code that needs it (such as GNUmed). Other clients will be just fine with the newer, more efficient setting with the same server, database, and role. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
В списке psycopg по дате отправления: