[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving symbolic variables in a database

From: Olaf Till
Subject: Re: Saving symbolic variables in a database
Date: Fri, 11 Mar 2016 21:41:35 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Mar 10, 2016 at 09:25:19AM +0100, Olaf Till wrote:
> On Wed, Mar 09, 2016 at 10:05:53AM -0800, diego9j wrote:
> > ...
> > As a part of a bigger project, I need to store a symbolic variable (from
> > symbolic package) into a postgres database (with database package). I got
> > one idea of how to do it but I'm having some trouble that I can't solve, so
> > both new ideas and solutions for my problem are welcome.
> > 
> > Since there's no "direct" way of storing symbolic variables in postgres, I
> > thought about storing the binary data of the variable, something like:
> > 
> > binary_data=save("-binary","-","symbolic_variable_name");
> > 8bit_data=uint8(binary_data);
> > 
> > Then I store it with pq_exec_params as bytea postgres type. The problem is
> > that
> > 1 - I found no function to parse back from 8-bit to binary
> > 2 - I don't know how to make that binary data a variable again
> > 
> > When doing simple file i/o, you save the binary to a file and then with the
> > "load" function, the variable "pops out" again, but I don't know how to do
> > that with an octave string.
> ...
> It's nice to see someone using the database package. But it wasn't
> designed to store _arbitrary_ Octave variables into a database. But if
> there really is such a need, maybe the database package itself should
> provide a way, as long as there is no satisfying possibility with
> Octaves save/load. Some functions like 'var2bytea' and
> 'bytea2var'. I'd guess I could add these within a few days, if really
> necessary ...

I didn't hear anything again from you, but the functions suggested
above are now added to 'database', see function documentation. A new
package release still must wait a bit, tell me if you should urgently
need this functionality but need help in accessing the code


public key id EAFE0591, e.g. on x-hkp://

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]