Hi, How does your database look like? I can't reproduce the problem using
create table test(id int primary key); ALTER TABLE test DROP PRIMARY KEY; You can get the CREATE statements by running SCRIPT NODATA TO 'test.sql'; Regards, Thomas On Thu, Jan 8, 2009 at 9:15 PM, Alex <[email protected]> wrote: > > Hello Thomas, > > I am trying to drop the primary key on a table. > I get the error below. The actual index name is "PRIMARY_KEY_6". > It looks like it's trying to delete the index "PRIMARY_KEY_" > > Alex > > > ALTER TABLE TARGET_IDS DROP PRIMARY KEY; > Index PRIMARY_KEY_ not found; SQL statement: > ALTER TABLE TARGET_IDS DROP PRIMARY KEY [42112-104] 42S12/42112 (Help) > org.h2.jdbc.JdbcSQLException: Index PRIMARY_KEY_ not found; SQL > statement: > ALTER TABLE TARGET_IDS DROP PRIMARY KEY [42112-104] > at org.h2.message.Message.getSQLException(Message.java:103) > at org.h2.message.Message.getSQLException(Message.java:114) > at org.h2.message.Message.getSQLException(Message.java:77) > at org.h2.table.Table.getPrimaryKey(Table.java:558) > at org.h2.command.Parser.parseAlterTable(Parser.java:4299) > at org.h2.command.Parser.parseAlter(Parser.java:3816) > at org.h2.command.Parser.parsePrepared(Parser.java:305) > at org.h2.command.Parser.parse(Parser.java:288) > at org.h2.command.Parser.parse(Parser.java:260) > at org.h2.command.Parser.prepareCommand(Parser.java:232) > at org.h2.engine.Session.prepareLocal(Session.java:344) > at org.h2.engine.Session.prepareCommand(Session.java:305) > at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java: > 1043) > at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:151) > at org.h2.server.web.WebThread.getResult(WebThread.java:1723) > at org.h2.server.web.WebThread.query(WebThread.java:1286) > at org.h2.server.web.WebThread.process(WebThread.java:444) > at org.h2.server.web.WebThread.processRequest(WebThread.java:186) > at org.h2.server.web.WebThread.process(WebThread.java:241) > at org.h2.server.web.WebThread.run(WebThread.java:196) > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
