Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql	30 Sep 2003 15:59:40 -0000	1.8
+++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0d2-5.0d3.sql	1 Oct 2003 11:23:06 -0000	1.9
@@ -199,11 +199,14 @@
                       references auth_authorities(authority_id);
 
 alter table users add username varchar(100);
+update users set username = '-';
 -- set all current users' username to equal their email
 -- and their authority to be the local authority
+-- Exclude the unregistered visitor as he/she has a null email
 update users 
 set    username = (select email from parties where party_id = user_id),
-       authority_id = (select authority_id from auth_authorities where short_name = 'local');
+       authority_id = (select authority_id from auth_authorities where short_name = 'local')
+and user_id <> 0;
 
 -- Does not work with PG 7.2
 -- alter table users alter column username set not null;
