PostgreSQL represents users as roles. There are roles that can log in called login roles. There are roles contain other roles. There are roles that both can log in and contain other roles.
This article demonstrates how to programmatically change user passwords in SAP NetWeaver Portal using available API. For applications with very high number of users, they may be better off keeping some references to portal users in their databases. For instance, an application can cache user ids in its database when new users are created. In that that way, it has readily available list of users at its disposal. Certain non-critical queries can be delegated to the RDBMS to reduce hits to the portal.