Giriş
Kullanıcı bilgilerini değiştirmek için ALTER ROLE kullanılır.
CREATE ROLE ve CREATE USER Farkı Nedir?
Açıklaması şöyle.
In PostgreSQL 9.4 documentation it says: "CREATE USER is now an alias for CREATE ROLE. The only difference is that when the command is spelled CREATE USER, LOGIN is assumed by default, whereas NOLOGIN is assumed when the command is spelled CREATE ROLE."
Açıklaması şöyle. Yani NOLOGIN kullanıcıları grup policy gibi düşünmek gerekir.
According to the description the LOGIN/NOLOGIN attribute determines whether or not a role can be used to connect from a client. A client can be anything from your pgAdmin III to lets say a web application. To test this you might want to create a role with LOGIN attribute and use it instead of your postgres role to connect to your server via pdAdmin III.A role with NOLOGIN attribute can't do this. This type of role can be regarded as an object you can add privileges to. LOGIN roles might then inherit those privileges by adding them as a member. One can think of the whole matter in terms of groups and users being members of groups.So after all I think this is just another way of expressing what you already said.
Örnek
Örnek
emp4 isminde yeni kullanıcı yaratmak için şöyle yaparız.
CREATE ROLE emp4 WITH LOGIN PASSWORD 'password';
Örnek
felix isminde ve şifresi süreli yeni kullanıcı yaratmak için şöyle yaparız.
CREATE ROLE felix WITH LOGIN PASSWORD 'password' VALID UNTIL '2020-09-30';