We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


How to enable primary keys for the populated tables? — Vertica Forum

How to enable primary keys for the populated tables?

When I created the tables and the constraints, I forgot to do the following:

ALTER DATABASE warehouse SET EnableNewPrimaryKeysByDefault = 1;
ALTER DATABASE warehouse SET EnableNewUniqueKeysByDefault = 1;

Now I have populated the tables, how can I enforce the primary keys without staring over?

Comments

  • drlovedrlove Employee

    You can enable a constraint on an already populated table with ALTER TABLE. The constraint would be enforced for current content as well as content you add to the table later.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file