Hi,

Internally (as in in the MonetDB code base),
the impact of the problem could imho be significantly reduced (though not fully avoided)
by "simply" using different separator characters (or even strings?) when creating qnames,
e.g. schema:table;column instead
of    schema_table_column ...

A unique bijective reversible mapping from schema,table,column to qname should avoid the problem entirely , but might require to use separator chracter(s) that are not valid in SQL identifiers, if such exist ...

Best,
Stefan


-------- Original message --------
From: Ying Zhang <Y.Zhang@cwi.nl>
Date: 28/11/2018 07:33 (GMT+01:00)
To: Communication channel for MonetDB users <users-list@monetdb.org>
Subject: Re: Issues trying to create a table...

> On 28 Nov 2018, at 04:18, Herman Knief <hknief@gmail.com> wrote:
>
> Hi Folks,
> I'm new to MonetDB and trying to setup a schema from a MariaDB export.
> I have a particular table that reports a conflict with the create statement.  I've stripped this down to just a particular field that seems to be causing the issue, but unsure where to go from here.
>
> sql>CREATE TABLE "sc_cat_item_delivery_plan" ("script" string);
> CREATE TABLE: zboot_sc_cat_item_delivery_plan_script conflicts

Hai Herman,

This is because something has already been defined before, whose complete qname is “zboot_sc_cat_item_delivery_plan_script”.  This often happens with (but probably not limited to) schema_name+table_name+column_name.  In MonetDB test suite, we have two examples to trigger this (type of) error:

sql>create table foo (id integer, bar_id integer);
operation successful
sql>create table foo_bar (id integer);
CREATE TABLE: sys_foo_bar_id conflicts

and

sql>create table foo_bar (baz int);
operation successful
sql>create table foo (bar_baz int);
CREATE TABLE: sys_foo_bar_baz conflicts

This is not a bug.  You need to change your table and/or column definitions, like your alternatives below.  Then CREATE TABLE will succeed.

Regards,
Jennie

>
> What's interesting is that either changing the name of the table or the name of the field and these statements work.  There is something about this particular combo that is problematic. 
> sql>CREATE TABLE "sc_cat_item_delivery_plan1" ("script" string);
> operation successful
> sql>CREATE TABLE "sc_cat_item_delivery_plan" ("script1" string);
> operation successful
>
> I have a total of 2251 tables... all were created except for this one.  I've tried to destroy and recreate the schema with no luck.  Logs don't seem to indicate any issue and trying to use the debug on the client didn't get me anywhere.  Thoughts?  Suggestions? 
>
> --
> Please excuse typos... I can't type.
> _______________________________________________
> users-list mailing list
> users-list@monetdb.org
> https://www.monetdb.org/mailman/listinfo/users-list

_______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list