Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Duplicate Primary Key

Hi, I am using the vertica-docker image and access Vertica using the jdbc-driver with DBVisualizer. I created an example table with
CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255)), PRIMARY KEY(PersonID));
Then I inserted the same row twice:
INSERT INTO public.Persons VALUES(1, 'Max', 'Muster', 'Street_1', 'Berlin');
INSERT INTO public.Persons VALUES(1, 'Max', 'Muster', 'Street_1', 'Berlin');
and it worked.
Select * from public.Persons

PersonID LastName FirstName Address City
1 Max Muster Street_1 Berlin
1 Max Muster Street_1 Berlin

Should that be prevented by the Primary key attribute?

Best Answers


Leave a Comment

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

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.