Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TSv8v-0004zD-N6 for pgsql-odbc@postgresql.org; Mon, 29 Oct 2012 19:37:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TSv8u-0004k8-Iq for pgsql-odbc@postgresql.org; Mon, 29 Oct 2012 19:37:01 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q9TJavfx022949; Mon, 29 Oct 2012 15:36:57 -0400 (EDT) From: Tom Lane To: =?utf-8?Q?Nils_G=C3=B6sche?= cc: pgsql-odbc@postgresql.org Subject: Re: Empty bytea values on 9.2.1 In-reply-to: <006a01cdb5fe$f8400c00$e8c02400$@de> References: <006a01cdb5fe$f8400c00$e8c02400$@de> Comments: In-reply-to =?utf-8?Q?Nils_G=C3=B6sche?= message dated "Mon, 29 Oct 2012 18:58:14 +0100" Date: Mon, 29 Oct 2012 15:36:57 -0400 Message-ID: <22948.1351539417@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) X-Archive-Number: 201210/14 X-Sequence-Number: 10973 =?utf-8?Q?Nils_G=C3=B6sche?= writes: > On an 8.4 installation, I have a table with a bytea column. In some rows, the > value of this column has length 0. When I query that table with a normal SELECT, > using the ODBC driver from C#, I get a byte[] object of length 0 on those rows. > So far so good. > Now, I dumped the database and restored it on a 9.2.1 installation. 9.0 and later default to showing bytea output in "hex" format. I wonder whether you are using a version of the ODBC code that handles that. If not, you many need to set "bytea_output" to "escape". regards, tom lane