Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 543A09FA004 for ; Fri, 2 Nov 2007 17:56:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 12050-04 for ; Fri, 2 Nov 2007 17:56:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by postgresql.org (Postfix) with ESMTP id 451029FA000 for ; Fri, 2 Nov 2007 17:56:08 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id u77so1927121pyb for ; Fri, 02 Nov 2007 13:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=onrVQEbOI2hcwjCabFcGJSpYvz/0bptptHe/RN55E/4=; b=iCIBaGdSBHmQBB8iFxqCBqvEulDQkff+7f4LeN8eaFTykjCgqOcy/YAqJmoKcIBuxqBLkuk0rxu43TlLStPBdFqekfpBFxOlEy+0DOxPt4Ea/m3MWoRXKhQrtsed2r7JsXwkhnodX/PEdprZEghQF2SvGYdmmUpF/DvtCoPcDbU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=kjw+Ll9KwTfOsA509MTkdHloGhgK2Sm51zUOEAnHjhYvIY+MCbo/Bj+fqwU/KSgx1L5+49kkZ6KbCRRh0LZkP9tnP0R+aKu+XfecN+8pzRIuZZydKJcVtL7XvHxZy8zT+VarveFGYG5RWLjwrqIhngSJ38ZxtQxAq8SqdQf2LK8= Received: by 10.65.103.14 with SMTP id f14mr7291870qbm.1194036966285; Fri, 02 Nov 2007 13:56:06 -0700 (PDT) Received: from ?192.168.1.33? ( [82.27.239.46]) by mx.google.com with ESMTPS id c9sm3536535nfi.2007.11.02.13.56.03 (version=SSLv3 cipher=RC4-MD5); Fri, 02 Nov 2007 13:56:04 -0700 (PDT) Message-ID: <472B8EE1.5090307@enterprisedb.com> Date: Fri, 02 Nov 2007 20:56:01 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: Kees Kling CC: pgsql-jdbc@postgresql.org Subject: Re: storing large arrays of floats References: <472B8311.6080505@planet.nl> In-Reply-To: <472B8311.6080505@planet.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/3 X-Sequence-Number: 17758 Kees Kling wrote: > I have to store an array of 50,000 floats in a postgres database. At > firts I tried to store it as float[], but that take s to much time for > jdbc to convert the data so that it can be stored in the database. > Next I tried to store it as byte[] array in a BYTEA column. This worked > ok, but when I inspect the data at the serverside the datasize increased > with a factor 1,5 to 2 and I see a lot of escape(\0) characters. What I > mean to do is storing the bunch of data and retrieving subselections of > the data with the help of Plperl fucntions. Now I can't restore the data > at serverside. What is the clue? Do I have to store the data with > another function as "preparedstatement.setBytes" or must I use another > columntype. Sounds like you need to rethink your schema. Instead of using an array, consider using a child table. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com