[erlang-questions] mnesia, ordered_set and disc_copies
Philip Clarke
send2philip@REDACTED
Thu Nov 1 10:42:44 CET 2012
Hi Jachym,
Yes, mnesia:create_schema is what I forgot to do.
Thanks for your help.
Philip
On Wed, Oct 31, 2012 at 9:09 PM, Jachym Holecek <freza@REDACTED>wrote:
> # Philip Clarke 2012-10-31:
> > Hi,
> >
> > I have a simple record defined as:
> > -record(user, {id, name}).
> >
> > Next I start up mnesia and try to create a table as follows:
> >
> > mnesia:create_table(user, [{type, ordered_set}, {disc_copies, [node()]},
> > {attributes, record_info(fields, user)}]).
> >
> > This gives me this error:
> > {aborted,{bad_type,user,disc_copies,nonode@REDACTED}}
> >
> >
> > If i change the table type to be ram_copies, everything works fine.
> > I realise that I cannot use disc_only_copies with ordered_set, but I
> > thought that disc_copies was supported.
> >
> > Am I doing something else wrong ?
>
> Did you forget to install disc_copies schema first? I don't think you can
> have disc_copies tables with ram_copies schema.
>
> Eshell V5.8.5 (abort with ^G)
> (foo@REDACTED)1> mnesia:create_schema([node()]).
> ok
> (foo@REDACTED)2> mnesia:start().
> ok
> (foo@REDACTED)3> mnesia:create_table(user, [{type, ordered_set},
> {disc_copies, [node()]},
> {attributes, [id, name]}]).
> {atomic,ok}
>
> BR,
> -- Jachym
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121101/9ad26446/attachment.htm>
More information about the erlang-questions
mailing list