Import from slack: BulkImport: Some users not found

Strange, I can’t find them:

mattermost=> SELECT Users.Id, Users.CreateAt, Users.UpdateAt, Users.DeleteAt, Users.Username, Users.Password, Users.AuthData, Users.AuthService, Users.Email, Users.EmailVerified, Users.Nickname, Users.FirstName, Users.LastName, Users.Position, Users.Roles, Users.AllowMarketing, Users.Props, Users.NotifyProps, Users.LastPasswordUpdate, Users.LastPictureUpdate, Users.FailedAttempts, Users.Locale, Users.Timezone, Users.MfaActive, Users.MfaSecret, Users.MfaUsedTimestamps, Users.RemoteId, Users.LastLogin, b.UserId IS NOT NULL AS IsBot, COALESCE(b.Description, '') AS BotDescription, COALESCE(b.LastIconUpdate, 0) AS BotLastIconUpdate FROM Users LEFT JOIN Bots b ON ( b.UserId = Users.Id ) WHERE Username IN ('Ralph','Patrick', 'Joshua', 'Sasha') ORDER BY Users.Username ASC
mattermost->
mattermost-> ;
 id | createat | updateat | deleteat | username | password | authdata | authservice | email | emailverified | nickname | firstname | lastname | position | roles | allowmarketing | props | notifyprops | lastpasswordupdate | lastpictureupdate  | failedattempts | locale | timezone | mfaactive | mfasecret | mfausedtimestamps | remoteid | lastlogin | isbot | botdescription | botlasticonupdate
----+----------+----------+----------+----------+----------+----------+-------------+-------+---------------+----------+-----------+----------+----------+-------+----------------+-------+-------------+--------------------+-------------------+----------------+--------+----------+-----------+-----------+-------------------+----------+-----------+-------+----------------+-------------------
(0 rows)

I also did this:

SELECT DISTINCT Users.username FROM Users;

I noticed that all usernames are lower case now.

So I changed your query to use lower case user name as (‘ralph’,‘patrick’, ‘joshua’, ‘sasha’):

mattermost=> SELECT Users.Id, Users.CreateAt, Users.UpdateAt, Users.DeleteAt, Users.Username, Users.Password, Users.AuthData, Users.AuthService, Users.Email, Users.EmailVerified, Users.Nickname, Users.FirstName, Users.LastName, Users.Position, Users.Roles, Users.AllowMarketing, Users.Props, Users.NotifyProps, Users.LastPasswordUpdate, Users.LastPictureUpdate, Users.FailedAttempts, Users.Locale, Users.Timezone, Users.MfaActive, Users.MfaSecret, Users.MfaUsedTimestamps, Users.RemoteId, Users.LastLogin, b.UserId IS NOT NULL AS IsBot, COALESCE(b.Description, '') AS BotDescription, COALESCE(b.LastIconUpdate, 0) AS BotLastIconUpdate FROM Users LEFT JOIN Bots b ON ( b.UserId = Users.Id ) WHERE Username IN ('ralph','patrick', 'joshua', 'sasha') ORDER BY Users.Username ASC;
             id             |   createat    |   updateat    | deleteat | username |                           password                           | authdata | authservice |        email        | emailverified | nickname | firstname | lastname  | position |    roles    | allowmarketing | props |                                                                                                                               notifyprops                                                                                                                                | lastpasswordupdate | lastpictureupdate | failedattempts | locale |                                    timezone                                     | mfaactive | mfasecret | mfausedtimestamps | remoteid | lastlogin | isbot | botdescription | botlasticonupdate
----------------------------+---------------+---------------+----------+----------+--------------------------------------------------------------+----------+-------------+---------------------+---------------+----------+-----------+-----------+----------+-------------+----------------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------------+----------------+--------+---------------------------------------------------------------------------------+-----------+-----------+-------------------+----------+-----------+-------+----------------+-------------------
... good data ...
(4 rows)

Now I can find all 4 rows and they all look right. What does this tell us?