Thank you,
alter table pref_users add constraint pref_users_medals_check check
(medals >= 0);
has worked!
I do not use pgAdmin, because I see in the logs of my 2 web server,
that attackers look for it all the time. But I'll install it at my
development VM at home now.
Regards
Alex