Обсуждение: grant user access

Поиск
Список
Период
Сортировка

grant user access

От
Tom Allison
Дата:
I'm stuck.

How do I grant select, insert, delete, update rights to an entire database?

I tried this:

GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE foo TO bar;

and it returns
ERROR:  syntax error at or near "INSERT" at character 14

I'm just not getting it, it sure looks like I should be able to.
I'm logged in as postgres.


Re: grant user access

От
mike g
Дата:
See http://www.postgresql.org/docs/7.4/static/sql-grant.html

Looks like you need something like GRANT ALL SELECT, ... ON DATABASE foo
To bar;

The below syntax is for table / view level grants.

Mike

On Sat, 2004-07-17 at 20:38, Tom Allison wrote:
> I'm stuck.
>
> How do I grant select, insert, delete, update rights to an entire database?
>
> I tried this:
>
> GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE foo TO bar;
>
> and it returns
> ERROR:  syntax error at or near "INSERT" at character 14
>
> I'm just not getting it, it sure looks like I should be able to.
> I'm logged in as postgres.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: grant user access

От
Bruno Wolff III
Дата:
On Sat, Jul 17, 2004 at 23:35:35 -0500,
  mike g <mike@thegodshalls.com> wrote:
> See http://www.postgresql.org/docs/7.4/static/sql-grant.html
>
> Looks like you need something like GRANT ALL SELECT, ... ON DATABASE foo
> To bar;

I don't think this does all of what he wants. That just lets him
create schemas and use the database.
To grant access to the tables, schemas and sequences he needs to write
queries to get the names of those objects and then issue grants to them.