ERROR: syntax error at or near "on":
Move the check
after on delete cascade
id varchar(32) references balkan_users(id) on delete cascade check (id <> author),
ERROR: syntax error at end of input:
remove the semicolon at the last column primary key(id, author);