
Hello together, I’m very new to MonetDB, so please be gracious :) I’m trying to drop a foreign key, what should be a very simple task – but I didn’t manage to do it. The following statement ran successfully – as the result says – but the foreign key is still there: alter table visit drop constraint visit_configuration_id_fkey; I also tried this – but this command is not supported?? alter table visit drop foreign key visit_configuration_id_fkey; An error occurred when executing the SQL command: alter table visit drop foreign key visit_configuration_id_fkey syntax error, unexpected FOREIGN in: "alter table visit drop foreign" [SQL State=42000] Execution time: 0.01s 1 statement failed. Best regards and thanks for any hints, Alex

On Jan 04, 2016, at 20:05, Alexander Gordt
wrote: Hello together,
I’m very new to MonetDB, so please be gracious :) I’m trying to drop a foreign key, what should be a very simple task – but I didn’t manage to do it.
The following statement ran successfully – as the result says – but the foreign key is still there:
alter table visit drop constraint visit_configuration_id_fkey;
I also tried this – but this command is not supported??
Hai Alex, I checked our SQL grammar (see sql_parser.y) and the monetdb.org documentation of DROP statement [1], this syntax indeed seems to be unsupported… Regards, Jennie [1] https://www.monetdb.org/Documentation/Manuals/SQLreference/DropStatement
alter table visit drop foreign key visit_configuration_id_fkey;
An error occurred when executing the SQL command: alter table visit drop foreign key visit_configuration_id_fkey
syntax error, unexpected FOREIGN in: "alter table visit drop foreign" [SQL State=42000]
Execution time: 0.01s 1 statement failed.
Best regards and thanks for any hints,
Alex
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list

Hey, thanks for your reply Jennie, but what about the other variant with 'constraint'. It generally is more about the 'alter statements' than the 'drop statements'... In general: how do you maintain your productive schemas? You don't seem to use the SQL interface - but which other interface should I use instead? Best regards, Alex
Am 04.01.2016 um 22:44 schrieb Ying Zhang
: On Jan 04, 2016, at 20:05, Alexander Gordt
wrote: Hello together,
I’m very new to MonetDB, so please be gracious :) I’m trying to drop a foreign key, what should be a very simple task – but I didn’t manage to do it.
The following statement ran successfully – as the result says – but the foreign key is still there:
alter table visit drop constraint visit_configuration_id_fkey;
I also tried this – but this command is not supported??
Hai Alex,
I checked our SQL grammar (see sql_parser.y) and the monetdb.org documentation of DROP statement [1], this syntax indeed seems to be unsupported…
Regards,
Jennie
[1] https://www.monetdb.org/Documentation/Manuals/SQLreference/DropStatement
alter table visit drop foreign key visit_configuration_id_fkey;
An error occurred when executing the SQL command: alter table visit drop foreign key visit_configuration_id_fkey
syntax error, unexpected FOREIGN in: "alter table visit drop foreign" [SQL State=42000]
Execution time: 0.01s 1 statement failed.
Best regards and thanks for any hints,
Alex
_______________________________________________ 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

On Jan 04, 2016, at 23:10, Alexander Gordt
wrote: Hey,
thanks for your reply Jennie, but what about the other variant with 'constraint'. It generally is more about the 'alter statements' than the 'drop statements'…
I just did a quick search for the keyword DROP to verify that the syntax error you got is expected. A quick search for CONSTRAINT in both sql.parser.y and the ‘alter statement’ documentation [2] shows that ALTER TABLE … DROP CONSTRAINT should be supported. What’s the problem you got with dropping constraint? Can you please give us the complete SQL scripts to reproduce the problem?
In general: how do you maintain your productive schemas? You don't seem to use the SQL interface - but which other interface should I use instead?
I’m afraid I don’t understand. A.f.a.i.k., schema management is done using SQL, although some features may not be supported (yet). Regards, Jennie [2] https://www.monetdb.org/Documentation/SQLreference/Alter
Best regards,
Alex
Am 04.01.2016 um 22:44 schrieb Ying Zhang
: On Jan 04, 2016, at 20:05, Alexander Gordt
wrote: Hello together,
I’m very new to MonetDB, so please be gracious :) I’m trying to drop a foreign key, what should be a very simple task – but I didn’t manage to do it.
The following statement ran successfully – as the result says – but the foreign key is still there:
alter table visit drop constraint visit_configuration_id_fkey;
I also tried this – but this command is not supported??
Hai Alex,
I checked our SQL grammar (see sql_parser.y) and the monetdb.org documentation of DROP statement [1], this syntax indeed seems to be unsupported…
Regards,
Jennie
[1] https://www.monetdb.org/Documentation/Manuals/SQLreference/DropStatement
alter table visit drop foreign key visit_configuration_id_fkey;
An error occurred when executing the SQL command: alter table visit drop foreign key visit_configuration_id_fkey
syntax error, unexpected FOREIGN in: "alter table visit drop foreign" [SQL State=42000]
Execution time: 0.01s 1 statement failed.
Best regards and thanks for any hints,
Alex
_______________________________________________ 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
users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list

Hi,
In the meantime I managed to execute the following script via command line:
#########
CREATE TABLE mymaster
(
id BIGINT,
value VARCHAR (255),
PRIMARY KEY (id)
);
CREATE TABLE myslave
(
master_id BIGINT,
value VARCHAR(255),
FOREIGN KEY (master_id) REFERENCES mymaster (id)
);
select * from sys.keys k where k.id = (select id from sys.tables t where t.name = 'myslave');
alter table myslave drop constraint
participants (2)
-
Alexander Gordt
-
Ying Zhang