Here is a little SQL excerpt:

CREATE TABLE IF NOT EXISTS A (A INT);

CREATE TABLE IF NOT EXISTS B (B INT AS SELECT A FROM A);
DROP TABLE A,B CASCADE;

On running it, I get
Cannot drop "PUBLIC.A" because "PUBLIC.B" depends on it; SQL statement:
drop table a cascade 
[90107-171]<http://192.168.126.1:8082/query.do?jsessionid=d35c360fc3d351af574128cb3a485239#>90107/90107
 
(Help) <http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c90107>

Technically speaking, this was to be expected: after all, the doc only 
promises that "All dependent views are dropped as well if the CASCADEclause is 
used." However, DROP SCHEMA and even DROP ALL OBJECTS yield the 
same result, although the doc for the latter says, "Drops all existing 
views, tables, sequences, schemas, function aliases, roles, user-defined 
aggregate functions, domains, and users (except the current user)."

A look-up of all of the INFORMATION_SCHEMA tables shows that the above 
dependency is only kept track of in TABLES / COLUMNS in the SQL form, so I 
see no reasonable way to drop a table without going to unreasonable lengths 
figuring out its dependants.

Yet a method must exist to just force dropping a table (please don't 
suggest DROP TABLE B,A instead of DROP TABLE A,B).
Or have I run into a design flaw?

Thanks,
Vladimir

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to