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 ;
#########
This all seems to work via command line client. When working with SQL Workbench/J via JDBC I’ve had some trouble, which made me writing my mailing list question.
Is there any difference between the command line client and the JDBC Client? Is it possible, that some request don’t work via JDBC that work via the command line client?
When I try the script from SQL Workbench/J via JDBC, then the database crashes.
Any idea?
Best regards,
Alex
Am 04.01.16, 23:40 schrieb "users-list im Auftrag von Ying Zhang" mailto:users-list-bounces+alexandergordt=adtelligence.de@monetdb.org im Auftrag von Y.Zhang@cwi.nlmailto:Y.Zhang@cwi.nl>:
On Jan 04, 2016, at 23:10, Alexander Gordt mailto:alexandergordt@adtelligence.de> 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 mailto:Y.Zhang@cwi.nl>:
On Jan 04, 2016, at 20:05, Alexander Gordt mailto:alexandergordt@adtelligence.de> 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.orgmailto:users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________
users-list mailing list
users-list@monetdb.orgmailto:users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________
users-list mailing list
users-list@monetdb.orgmailto:users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list
_______________________________________________
users-list mailing list
users-list@monetdb.orgmailto:users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list