I have two tables, one called 'persons' the other called 'results'.
persons has an ID, and a playername.
Results has an ID, a playerID, and a score and time.
It seems logical to me that the "playerID" in results should not be unique (since the same player can have multiple scores), though when executing this query:
insert into results (playerid, score, time) values
((select id from persons where playername = 'Dylan'),100,100);
I get the error
ERROR: duplicate key value violates unique constraint "results_playerid_key"
DETAIL: Key (playerid)=(1) already exists.
Is this perhaps an error on the database? (The database is managed by several lecturers at my university, and I have no way of changing any settings).
Thanks for any insight you can provide.