Re: create role

From: tcapobianco(at)prospectiv(dot)com
To: "Gibransyah Fakhri" <gibransyah(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: create role
Date: 2010-12-31 16:22:23
Message-ID: 6b49785d598885ab7f8c5d3955afd74c.squirrel@mail.prospectiv.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> On 31 December 2010 05:14, Tony Capobianco <tcapobianco(at)prospectiv(dot)com>
> wrote:
>> esave_dw=> \d members
>> Did not find any relation named "members".
>> esave_dw=>
>> esave_dw=> \d esave.members
>>                     Table "esave.members"
>>       Column        |            Type             | Modifiers
>> ---------------------+-----------------------------+-----------
>>  memberid            | numeric                     | not null
>>  etc....
>>
>> How can I get this so I don't have to preface the \d with the schema
>> name every time?
>
> Hi Tony, you should changes the default search_path for the specified
> users.
> http://sql-info.de/postgresql/schemas.html
> take a look at practical schema usage section.
>

Gibransyah,
That did the trick! Thanks for your help. I modified my role name from
developer to dev since I already have a dev schema. Here's the steps I
ran below to get it working:

create role dev login;
alter role dev set default_tablespace=dev;
alter role dev set search_path=dev,staging, esave, support, email,public;

grant usage on schema esave to dev;
grant usage on schema dev to dev;
grant select on members to dev;
grant create on schema dev to dev;
grant create on tablespace dev to dev;

I am a little confused as to why I had to grant usage & create on dev to
dev since it's both the dev role's default_tablespace and has a schema
named after it. Either way, this corrects my issue. Thanks for your
help!

Tony

In response to

  • create role at 2010-12-30 22:14:23 from Tony Capobianco

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2010-12-31 16:34:07 Re: create role
Previous Message Adrian Klaver 2010-12-30 22:23:10 Re: create role