Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


1
(click on this box to dismiss)

Does CUBRID require to drop constraints before dropping the table constraints are defined in?

I have created a table with several constraints. If I need to drop the table, do I need to drop all those constraints I have created for this table before dropping the table? Or will CUBRID clean up everything for me?

link comment (0) accepted answer
asked 3 years ago
eye
91
1 Answer
1

I tried the following approach from http://www.cubrid.org/manual/840/en/Constraint%20Definition

I created 2 tables with a foreign key and when I tried to delete the first table an error was received stating that the primary key is referred by a foreign key and is not supposed to be dropped.

However, when I tried creating a table with an INDEX,UNIQUE or PRIMARY KEY constraint, drop table worked fine and deleted the constraint(s) also.

So, basically, if no FOREIGN KEY is set, then cubrid will clean up all the constraints and drop table will work fine. If a FOREIGN KEY is set, then the table with foreign key must be deleted first or the "DROP FOREIGN KEY" command must be used.

link comment (0)
answered 3 years ago
nicola_magdalena
248
tagged




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: