[erlang-questions] mnesia, ordered_set and disc_copies

47 views
Skip to first unread message

Philip Clarke

unread,
Oct 31, 2012, 12:43:35 PM10/31/12
to erlang-q...@erlang.org
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@nohost}}


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 ?

Thanks
Philip

Jachym Holecek

unread,
Oct 31, 2012, 5:09:44 PM10/31/12
to Philip Clarke, erlang-q...@erlang.org
# Philip Clarke 2012-10-31:
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@taiga)1> mnesia:create_schema([node()]).
ok
(foo@taiga)2> mnesia:start().
ok
(foo@taiga)3> mnesia:create_table(user, [{type, ordered_set},
{disc_copies, [node()]},
{attributes, [id, name]}]).
{atomic,ok}

BR,
-- Jachym
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Philip Clarke

unread,
Nov 1, 2012, 5:42:44 AM11/1/12
to Jachym Holecek, erlang-q...@erlang.org
Hi Jachym,

Yes, mnesia:create_schema is what I forgot to do.
Thanks for your help.

Philip
Reply all
Reply to author
Forward
0 new messages