Just add a Unique constraint over both columns to your CREATE TABLE
statement:
CREATE TABLE person(
... -- more columns
username text
,person_id int
,UNIQUE (username, person_id)
);
That does it. I see that @Hamlet and @Frank already commented likewise.