Moodle’s postgres7.sql is missing a
lang char(5) default declaration in prefix_user. This causes user additions to
fail. To fix an already set up database, simply
ALTER TABLE moodle ADD COLUMN lang CHAR(5); ALTER TABLE moodle ALTER lang SET DEFAULT 'en';
Picture should not have an empty string. Fixed by adding $user->picture = -1 .
Just discovered http://www.softwarequotes.com =)