We are using suid > 2 and altuid = 0 to know if it is not system user but a application user.
This is working in most of the cases
The only problem when we restore a backup of one server DB to a DB on another it is setting suid to null as corresponding users may not have logins in this server.
to overcome this I am using ((Uid > 3 and suid=null) or suid > 2) and altuid = 0.
can any one suggest me a better way to do what we are doing now.