From ruby-talk-admin@ruby-lang.org Mon Oct 11 18:54:45 2004 Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (8.12.3/8.12.3/Debian-6.6) with ESMTP id i9B9sjml020555; Mon, 11 Oct 2004 18:54:45 +0900 Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id A3C6459A7; Mon, 11 Oct 2004 18:54:46 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id DEF5FF04837; Mon, 11 Oct 2004 18:54:48 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id DC7A1F04842; Mon, 11 Oct 2004 18:54:47 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [210.251.121.210]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id D36A363002D; Mon, 11 Oct 2004 18:54:49 +0900 (JST) Received: from localhost (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 916EF34414; Mon, 11 Oct 2004 18:54:45 +0900 (JST) Received: from beryllium.ruby-lang.org ([127.0.0.1]) by localhost (beryllium.ruby-lang.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29204-04; Mon, 11 Oct 2004 18:54:45 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 1987F34311; Mon, 11 Oct 2004 18:54:43 +0900 (JST) Received: from localhost (beryllium.ruby-lang.org [127.0.0.1]) by beryllium.ruby-lang.org (Postfix) with ESMTP id C35913455D for ; Mon, 11 Oct 2004 18:54:37 +0900 (JST) Received: from beryllium.ruby-lang.org ([127.0.0.1]) by localhost (beryllium.ruby-lang.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29204-02 for ; Mon, 11 Oct 2004 18:54:37 +0900 (JST) Received: from neutron.zrz.tu-berlin.de (neutron.zrz.TU-Berlin.DE [130.149.2.47]) by beryllium.ruby-lang.org (Postfix) with ESMTP id 9E90734311 for ; Mon, 11 Oct 2004 18:54:36 +0900 (JST) Received: from localhost.localdomain (localhost [127.0.0.1]) by neutron.zrz.tu-berlin.de (SGI-8.12.5/8.12.5) with ESMTP id i9B9t1CW924677 for ; Mon, 11 Oct 2004 11:55:01 +0200 (CEST) Received: from Usenet via a Usenet to mail gateway located at TU-Berlin.DE. This service provided as a courtesy to the ruby-talk mailing list. If this message is SPAM, its ultimate origin is Usenet, not this gateway program. All subscribers to the ruby-talk mailing list agree to receive the Usenet postings made to comp.lang.ruby via this gateway. Please see http://www.ruby-lang.org/ruby-talk-usenet-policy.html. Delivered-To: ruby-talk@ruby-lang.org Date: Mon, 11 Oct 2004 18:54:38 +0900 Posted: Mon, 11 Oct 2004 12:48:27 +0300 From: George Moschovitis Reply-To: ruby-talk@ruby-lang.org Subject: [Q] Postgres bytea columns and Marshal load To: ruby-talk@ruby-lang.org (ruby-talk ML) Message-Id: X-ML-Name: ruby-talk X-Mail-Count: 116099 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org; help= User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) Path: zrz.TU-Berlin.DE!news-ber1.dfn.de!news-lei1.dfn.de!newsfeed00.sul.t-online.de!t-online.de!irazu.switch.ch!switch.ch!news.grnet.gr!news.ntua.gr!not-for-mail Newsgroups: comp.lang.ruby Organization: Navel NNTP-Posting-Host: 80.76.61.229 X-Trace: ulysses.noc.ntua.gr 1097488232 65294 80.76.61.229 (11 Oct 2004 09:50:32 GMT) X-Complaints-To: usenet@ulysses.noc.ntua.gr NNTP-Posting-Date: Mon, 11 Oct 2004 09:50:32 +0000 (UTC) X-Accept-Language: en-us, en X-From-Usenet: see Received: header above. X-rubymirror: yes X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on beryllium.ruby-lang.org X-Spam-Status: No, score=-2.5 required=7.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER autolearn=ham version=3.0.0 X-Spam-Level: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk Lines: 46 List-Id: ruby-talk.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ruby-lang.org X-Virus-Scanned: by AMaViS snapshot-20020531 Hello everyone, I have a table with a 'bytea' column in Postgres: CREATE TABLE my_tab { objectdump bytea } I Have an array wich i want to dump in this column: a = ["Hello", "World"] data = Marshal.dump(a) I dump the data: conn.exec("INSERT INTO my_tab (objectdump) VALUES (#{PGConn.escape_bytea(data)})") When i try to load the data: res = conn.exec("SELECT * FROM my_tab") a2 = Marshal.load(res.getvalue(0,0)) I get the following error: TypeError: incompatible marshal file format (can't be read) format version 4.8 required; 92.48 given My guess is that something like unescape_bytea is needed. Any idea? Thanks in advance, George Moschovitis -- www.navel.gr | tel: +30 2106898050 | fax: +30 2106898437 Navel does not accept liability for any errors, viruses or omissions in the contents of this message. The full corporate policy is available on our site. have fun: www.joy.gr