Postgresql – Ruby and Rails Blog https://rubyandrails.net This is where diamonds exists Sun, 25 Jul 2021 16:15:23 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 195321763 Mac OS – Creating a PostgreSQL Database Role (User) https://rubyandrails.net/forums/topic/postgresql-creating-a-database-role-for-your-application-mac-os/ Fri, 23 Jul 2021 15:54:10 +0000 https://rubyandrails.net/?topic=postgresql-creating-a-database-role-for-your-application-mac-os How-to Create a new user for use with the PostgreSQL DB on Mac OS
  1. Open the terminal from:
    Applications\Utilities\Terminal
    — See help link open link below for assistance
    Mac OS How-to Open Terminal
  2. Type command below from the terminal
    createuser -P -d appname
    — In this command, you used createuser to create a role named appname. The -d flag gave the role the permission to create new databases.
  3. login to postgres with following command from terminal:

    psql postgres
  4. Your terminal will look like this below with postgres=#
  5. While you’re logged in to psql, type the following to check to see the list of users in database

    postgres=#\du;
]]>
843