Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2010
    Location
    Orlando, FL
    Posts
    311
    Provided Answers: 1

    Unanswered: How To Modify Existing User

    I have an existing user called 'carlos' & I'm looking to see how how I can modify this user to be a superuser. I create that user using basic SQL commands:

    Code:
    CREATE USER carlos WITH PASSWORD 'booya';
    I know that from the Linux shell I can use the 'createuser' script but I chose not to do so & rather trying to do this via SQL commands. I did view the documents online but couldn't find what 'option(s)' I need to add into the command. Can anyone please help me?

    PostgreSQL: Documentation: Manuals: PostgreSQL 9.0: CREATE USER

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12

  3. #3
    Join Date
    Oct 2010
    Location
    Orlando, FL
    Posts
    311
    Provided Answers: 1
    Quote Originally Posted by shammat View Post
    Thank you. I did the following:

    Code:
    postgres=# ALTER USER carlos WITH SUPERUSER;
    ALTER ROLE
    My question now is if there's a way that you can create a new user with the 'CREATE USER' SQL command & also make them a 'superuser' or must I always run the 'ALTER USER' command?

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by CarlosinFL View Post
    My question now is if there's a way that you can create a new user with the 'CREATE USER' SQL command & also make them a 'superuser'
    Sure.
    That's all documented in the manual for the CREATE USER statement (just read the link you posted...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •