Complex `UNIQUE INDEX` scenario - Games, teams, players, positions!
You could use an EXCLUDE constraint:

create extension btree_gist ;
create table foo (game text, team text, player text, position text, 
    exclude using gist (game with =, player with =, team with != ));


You will want to put the != column at the end of the list of columns, otherwise enforcing the constraint will be slower.

insert into foo values ('1', 'detroit', 'parish','catcher');

insert into foo values ('1', 'cubs', 'parish','LF');

ERROR:  conflicting key value violates exclusion constraint "foo_game_player_team_excl"