pre postgres 15 can you solve this with two unique constraints ?
unique (EmployeeName), unique (EmployeeName, CarID)
unique (EmployeeName), unique (EmployeeName, CarID)
And if this is your employee table, you’d have UNIQUE (EmployeeData) and UNIQUE (CarID), and it would do what you want.