From mail at joeconway.com  Tue Mar 31 17:54:45 2009
From: mail at joeconway.com (Joe Conway)
Date: Tue, 31 Mar 2009 08:54:45 -0700
Subject: [Rd] external equiv to R_serialize()?
In-Reply-To: <alpine.LFD.2.00.0903310655041.19538@gannet.stats.ox.ac.uk>
References: <49D191A6.8010905@joeconway.com>
	<alpine.LFD.2.00.0903310655041.19538@gannet.stats.ox.ac.uk>
Message-ID: <49D23CC5.4050300@joeconway.com>

Prof Brian Ripley wrote:
> On Mon, 30 Mar 2009, Joe Conway wrote:
> 
>> I'm trying to efficiently allow conversion of R objects to PostgreSQL 
>> bytea (raw binary) datatype within PL/R for persistent storage in 
>> Postgres tables. I have found R_serialize() which looks like what I 
>> need, -- e.g. R_serialize(object, NULL, FALSE, NULL) -- except that it 
>> is marked attribute_hidden. Is there some other externally available 
>> interface that I can use?
> 
> R_Serialize is in Rinternals.h.  R_serialize is a wrapper using 
> connections, and connections do not have a public API.

OK, thanks.

> Do note the comments in ?serialize: 'persistent' storage of objects in 
> an experimental format is somewhat contradictory.

Good point -- I'll put a suitable warning in my documentation. The 
typical use case people describe is more of a "materialized view" than 
it is primary storage, so I think this is still very useful.

Thank you for your response.

Joe



[Rd] external equiv to R_serialize()?
Joe Conway