[erlang-questions] mnesia and simple records

Ahmed Omar <>
Thu Oct 14 22:01:23 CEST 2010


"{attributes, AtomList} a list of the attribute names for the records that
are supposed to populate the table. The default value is [key, val]. *The
table must have at least one extra attribute in addition to the key*."

http://www.erlang.org/doc/man/mnesia.html#create_table-2

On Thu, Oct 14, 2010 at 4:59 PM, Andrey Sidorenko <>wrote:

> Hi All,
>
> Is it correct, that it is not possible to create mnesia table for the
> record
> which contains just one member? What is the reason for such kind of
> limitation?
>
> Eshell V5.7.5  (abort with ^G)
> 1> mnesia:create_schema([node()]).
> ok
> 2> mnesia:start().
> ok
> 3> rd(test,{f1}).
> test
> 4> mnesia:create_table(test, [{attributes, record_info(fields, test)}]).
> {aborted,{bad_type,test,{attributes,[f1]}}}
> 5> rd(test2,{f1,f2}).
> test2
> 6> mnesia:create_table(test2, [{attributes, record_info(fields, test2)}]).
> {atomic,ok}
> 7>
>
> Thanks,
> Andrey
>



-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>


More information about the erlang-questions mailing list