Forum: Managing VoltDB

Post: How to do Alter Table?

How to do Alter Table?
tony7889
Aug 1, 2011
Hi,

I like to do something like Alter Table, so I can change the table structure with all my existing data keep. but I cannot find anything like Alter table, so for VoltDB, what is the best approach for this?

Thanks,
Tony
Hi Tony, Since the VoltDB
ajgent
Aug 1, 2011
Hi Tony,

Since the VoltDB schema is "pre-compiled" in the application catalog, instead of ALTER TABLE you need to update the catalog. This process is described in the Using VoltDB manual chapter 6, Updating Your VoltDB Application.

You can add or remove entire tables on a running database by using the @UpdateApplicationCatalog system procedure. However, if you want to add, remove, or modify individual columns, you must currently:



  1. Compile the new catalog with the desired changes.
  2. Take a snapshot of the database.
  3. Shutdown and restart the database using the new catalog.
  4. Restore the snapshot.

    This process is described in the section 6.3. Updating the Database Schema.

    --Andrew