Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 04B7C5962FA for ; Sat, 23 Jun 2012 08:12:49 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SiOGj-0000de-Jq for pgsql-general@postgresql.org; Sat, 23 Jun 2012 11:12:48 +0000 Received: by pbbrp8 with SMTP id rp8so4599699pbb.19 for ; Sat, 23 Jun 2012 04:12:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:x-gm-message-state; bh=UHuxU4MV0ZqK/EBCg4gSQaW88cLRwwgu8L2l4hYTOso=; b=ALnUctazdk5HwlC5fVGTEHeLDG+klIl9CFRiZF2OrjVHOnXlX64AG/DcyAm+T8968Y mMc9cYKuQLN2KjM+6vGMLE0KV0r8SRQYCqY06VoYBqIOpiHp2oqF8RHjWjM+Z2VGDnJN rMoQbhii4IXlqEfdUfGbZyzSxCyZpf5BHOAQ38j7F9iWbCDr0dZoTEVxPs7LAgp0jC56 6q8naX2/Vg4t5a4LgkfA6cQqffMDt8HK2RcZ8EdjNe/O8+zGJRynW0lyhMmOoMmRblt3 h5/lSqOleMfAaUsdxid92d8YCh2pXYs2Vg7ve4LBc44taQywhsy/ZVqjSsoIU4shAmQS bC2Q== Received: by 10.68.242.162 with SMTP id wr2mr19761253pbc.125.1340449949928; Sat, 23 Jun 2012 04:12:29 -0700 (PDT) Received: from ayaki.localdomain (124-169-169-118.dyn.iinet.net.au. [124.169.169.118]) by mx.google.com with ESMTPS id oy8sm2059336pbc.52.2012.06.23.04.12.27 (version=SSLv3 cipher=OTHER); Sat, 23 Jun 2012 04:12:29 -0700 (PDT) Message-ID: <4FE5A498.5040105@ringerc.id.au> Date: Sat, 23 Jun 2012 19:12:24 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Vishwas Dwivedi , "pgsql-general@postgresql.org" Subject: Re: [ADMIN] Issue in save and retreive file in postgres References: <4FE1E0AD.80405@ringerc.id.au> In-Reply-To: Content-Type: multipart/alternative; boundary="------------010904070902010505090809" X-Gm-Message-State: ALoCoQl3HiurW44heUM5GiZbC9575rINGCpP/W4FJ9YQbd1QTZceRF1lBcQ9Y/1xe3hd+xoX9ybS X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/565 X-Sequence-Number: 188345 This is a multi-part message in MIME format. --------------010904070902010505090809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 06/23/2012 02:48 PM, Vishwas Dwivedi wrote: > I am using postgreSQL 9.1. > > My problem is when I retrieve pdf file data from postgreSQL and create > a pdf > file in temp folder of my application. > > The file gets created but not able to open it, shows some error. > One more thing that in my code I am converting byte array to file > stream when saving and retrieving file from database. > > both time save and retrieve, the byte array size differs. I don't know > why? Please reply to the list, not to me. Unfortunately the list doesn't set reply-to. Please provide the FULL EXACT TEXT OF THE ERROR MESSAGE by copying and pasting it into an email. See: http://wiki.postgresql.org/wiki/Guide_to_reporting_problems As for byte array differences, which client library are you using? Is it possible it's outdated and doesn't understand bytea_format=hex ? See http://www.postgresql.org/docs/9.1/static/datatype-binary.html . -- Craig Ringer --------------010904070902010505090809 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 06/23/2012 02:48 PM, Vishwas Dwivedi wrote:
I am using postgreSQL 9.1.

My problem is when I retrieve pdf file data from postgreSQL and create a pdf
file in temp folder of my application.

The file gets created but not able to open it, shows some error.
One more thing that in my code I am converting byte array to file stream when saving and retrieving file from database.

both time save and retrieve, the byte array size differs. I don't know why?

Please reply to the list, not to me.  Unfortunately the list doesn't set reply-to.

Please provide the FULL EXACT TEXT OF THE ERROR MESSAGE by copying and pasting it into an email.

See: http://wiki.postgresql.org/wiki/Guide_to_reporting_problems


As for byte array differences, which client library are you using? Is it possible it's outdated and doesn't understand bytea_format=hex ?  See http://www.postgresql.org/docs/9.1/static/datatype-binary.html .

--
Craig Ringer
--------------010904070902010505090809--