- printf "INSERT INTO players (nick) VALUES ('%s');\n", $player;
- printf "INSERT INTO roundparticipation (tournament, round, parallel, player) VALUES (\n";
+
+ # Woot, evil
+ printf "INSERT INTO players SELECT nextval('players_player_seq') AS player, '%s' AS nick WHERE '%s' NOT IN ( SELECT nick FROM players );\n", $player, $player;
+
+ printf "INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (\n";