postgresql_16:7.2.3.1 Description
PostgreSQL 16 > Reference > PostgreSQL Client Applications > createuser > Description
createuser creates a new PostgreSQL user (or more precisely, a role). Only superusers and users with CREATEROLE privilege can create new users, so createuser must be invoked by someone who can connect as a superuser or a user with CREATEROLE privilege.
If you wish to create a role with the SUPERUSER, REPLICATION, or BYPASSRLS privilege, you must connect as a superuser, not merely with CREATEROLE privilege. Being a superuser implies the ability to bypass all access permission checks within the database, so superuser access should not be granted lightly. CREATEROLE also conveys very extensive privileges (see role-creation).
createuser is a wrapper around the SQL command CREATE ROLE (see postgresql_16:7.1.76). There is no effective difference between creating users via this utility and via other methods for accessing the server.