Defining Role Privileges

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: "PostgreSQL (General)" <pgsql-general(at)postgresql(dot)org>
Subject: Defining Role Privileges
Date: 2012-02-08 16:19:54
Message-ID: CAAQLLO4-6syMK1U0A7NuF3sCmz=rxr4R4DNuvhVVLtan1uNcew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm wondering about my CREATE ROLE statements for PostgreSQL. I guess
I don't know if there's an official answer but I feel like I'm
entering a lot of redundant privileges to a role for example:

CREATE ROLE tom NOINHERIT LOGIN SUPERUSER CREATEDB CREATEROLE REPLICATION;
CREATE ROLE

My question is do I need to specify CREATEDB & CREATEROLE if I'm
already granting the SUPERUSER privilege? Seems kind of redundant to
me, no? Is there any logical reason someone would be a SUPERUSER and
not have CREATEDB or CREATEROLE?

Also when I generate a new role, is there any difference between using:

ALTER ROLE tom ENCRYPTED PASSWORD 'md5081bea17b5503506d29531af33cc6f4e';

\password tom

Is there a downside to using the \password psql command? Is it also
encrypted like the statement above? How do you create roles and do you
do it manually or have some kind of template?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2012-02-08 16:51:09 Re: easy function or trigger to UPPER() all alpha data
Previous Message mgould 2012-02-08 15:55:07 easy function or trigger to UPPER() all alpha data