Duplicate Primary Key

joergschaberjoergschaber Vertica Customer

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

Answers

Leave a Comment

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