Received: from maia.hub.org (unknown [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8928D1337999 for ; Fri, 22 Oct 2010 19:24:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 98133-02 for ; Fri, 22 Oct 2010 22:24:34 +0000 (UTC) Received: from news.hub.org (unknown [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id B26CD133740B for ; Fri, 22 Oct 2010 19:24:33 -0300 (ADT) Received: from news.hub.org ([200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id o9MMOIgc042079 for ; Fri, 22 Oct 2010 19:24:18 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id o9MM67MX005794 for pgsql-general@postgresql.org; Fri, 22 Oct 2010 19:06:07 -0300 (ADT) (envelope-from news) From: ljb X-Newsgroups: pgsql.general Subject: Re: Gripe: bytea_output default => data corruption Date: Fri, 22 Oct 2010 22:06:07 +0000 (UTC) Organization: Hub.Org Networking Services Lines: 19 Message-ID: References: <201010212129.o9LLTBl21612@momjian.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: slrn/0.9.9p1 (Linux) To: pgsql-general@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.792 tagged_above=-5 required=5 tests=BAYES_40=-0.001, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201010/875 X-Sequence-Number: 168787 vivek@khera.org wrote: >... > I had some hoops thru which I had to jump to make our app compatible with > both 8.x and 9.x so we could safely migrate our servers without having to > coordinate a code push. It wasn't that bad, but part of the problem is that > the DBD::Pg driver does not understand the new format... but it does > unescape the "\x" marker for me to a simple "x", since that follows the > traditional un-escaping rules for values returned from Pg. I don't like > overriding defaults in the DB settings unless I *really* have to. Although DBD::Pg uses libpq, linking it with the PostgreSQL-9.0 libpq doesn't fix the escape/unescape problem. (I'm sure you already know this.) That's because DBD::Pg implements its own string and bytea escape and unescape functions, for some reason, and does not use PQescapeStringConn etc. (I wonder if that makes it vulnerable to the security problems fixed 8.1.4?) I probably would have just gone ahead and deployed 9.0 servers with "bytea_output='escape'" in their postgresql.conf files. Permanent work-around.