Lists: | Postg메이저 토토 사이트SQL |
---|
From: | Yang Zhang <yanghatespam(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-24 20:52:24 |
Message-ID: | AANLkTi=SOvSSUCP2VvfHj_UeL+ZG=v1DLX3eTdH34ev6@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Any way I can have all newly created schemas/tables be owned by, or
have all permissions granted to, a certain group, without having to
remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
advance.
From: | Stephen Frost <sfrost(at)snowman(dot)net> |
---|---|
To: | Yang Zhang <yanghatespam(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-24 20:56:11 |
Message-ID: | 20110324205611.GF4116@tamriel.snowman.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
* Yang Zhang (yanghatespam(at)gmail(dot)com) wrote:
> Any way I can have all newly created schemas/tables be owned by, or
> have all permissions granted to, a certain group, without having to
> remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
> advance.
ALTER DEFAULT PRIVILEGES FOR ROLE my_user IN SCHEMA my_schema
GRANT SELECT ON TABLES TO other_role;
http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html
Thanks,
Stephen
From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | Yang Zhang <yanghatespam(at)gmail(dot)com> |
Subject: | Re: Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-24 21:00:02 |
Message-ID: | 201103241400.02596.adrian.klaver@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg메이저 토토 사이트SQL |
On Thursday, March 24, 2011 1:52:24 pm Yang Zhang wrote:
> Any way I can have all newly created schemas/tables be owned by, or
> have all permissions granted to, a certain group, without having to
> remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
> advance.
If you are using 9.0:
http://www.postgresql.org/docs/9.0/interactive/sql-alterdefaultprivileges.html
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From: | "David Johnston" <polobo(at)yahoo(dot)com> |
---|---|
To: | "'Stephen Frost'" <sfrost(at)snowman(dot)net>, "'Yang Zhang'" <yanghatespam(at)gmail(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-24 22:17:18 |
Message-ID: | 015101cbea71d0e6a30$b72b3e90$@yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Keep in mind if you want to alter the GLOBAL privileges (i.e., the defaults)
granted via PUBLIC you MUST NOT specify a schema.
From what I can tell there is no way to associate a default owner different
that the one executing the CREATE statement (though some inheritance cases
do arise IIRC).
David J.
-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Stephen Frost
Sent: Thursday, March 24, 2011 4:56 PM
To: Yang Zhang
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Default permissions for CREATE SCHEMA/TABLE?
* Yang Zhang (yanghatespam(at)gmail(dot)com) wrote:
> Any way I can have all newly created schemas/tables be owned by, or
> have all permissions granted to, a certain group, without having to
> remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
> advance.
ALTER DEFAULT PRIVILEGES FOR ROLE my_user IN SCHEMA my_schema GRANT SELECT
ON TABLES TO other_role;
http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html
Thanks,
Stephen
From: | Yang Zhang <yanghatespam(at)gmail(dot)com> |
---|---|
To: | David Johnston <polobo(at)yahoo(dot)com> |
Cc: | Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-25 01:10:32 |
Message-ID: | AANLkTimLPGpcz6MsHGhQAT4iQE0VsW2VuVckA5WhoGUD@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Any luck if I'm still on 8.4?
On Thu, Mar 24, 2011 at 3:17 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> Keep in mind if you want to alter the GLOBAL privileges (i.e., the defaults)
> granted via PUBLIC you MUST NOT specify a schema.
>
> From what I can tell there is no way to associate a default owner different
> that the one executing the CREATE statement (though some inheritance cases
> do arise IIRC).
>
> David J.
>
> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Stephen Frost
> Sent: Thursday, March 24, 2011 4:56 PM
> To: Yang Zhang
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Default permissions for CREATE SCHEMA/TABLE?
>
> * Yang Zhang (yanghatespam(at)gmail(dot)com) wrote:
>> Any way I can have all newly created schemas/tables be owned by, or
>> have all permissions granted to, a certain group, without having to
>> remember to GRANT ALL ON [SCHEMA|TABLE] TO that group? Thanks in
>> advance.
>
> ALTER DEFAULT PRIVILEGES FOR ROLE my_user IN SCHEMA my_schema GRANT SELECT
> ON TABLES TO other_role;
>
> http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html
>
> Thanks,
>
> Stephen
>
>
--
Yang Zhang
http://yz.mit.edu/
From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | Yang Zhang <yanghatespam(at)gmail(dot)com>, David Johnston <polobo(at)yahoo(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net> |
Subject: | Re: Default permissions for CREATE SCHEMA/TABLE? |
Date: | 2011-03-25 02:09:18 |
Message-ID: | 201103241909.19271.adrian.klaver@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Thursday, March 24, 2011 6:10:32 pm Yang Zhang wrote:
> Any luck if I'm still on 8.4?
>
As far as I know, no luck. If you search the list archives there are some
scripts people have posted that will walk through a database or schema and
change permissions.
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com