# [email protected]:~ #
su - postgres
# Last login: Mon Apr 16 10:26:05 MYT 2018 on pts/0
# -bash-4.2$
psql
# psql (9.6.8)
# Type "help" for help.
#
# postgres=#
# [email protected]:~ #
su - postgres psql
# Last login: Mon Apr 16 10:25:10 MYT 2018 on pts/0
# /bin/createuser: /bin/createuser: cannot execute binary file
# [email protected]:~ #
su - postgres
# Last login: Mon Apr 16 10:26:05 MYT 2018 on pts/0
# -bash-4.2$
createuser root
# createuser: creation of new role failed: ERROR: role "root" already exists
# [email protected]:~ #
su - postgres
# Last login: Mon Apr 16 10:26:05 MYT 2018 on pts/0
# -bash-4.2$
createdb root
# postgres=#
grant all privileges on database root to root;
# GRANT
# postgres=#
grant all privileges on database postgres to root;
# GRANT