Re: Permission on insert rules

Поиск
Список
Период
Сортировка
От Luis Sousa
Тема Re: Permission on insert rules
Дата
Msg-id 3DD13751.1030100@ualg.pt
обсуждение исходный текст
Ответ на Permission on insert rules  (Luis Sousa <llsousa@ualg.pt>)
Ответы Re: Permission on insert rules  ("Josh Berkus" <josh@agliodbs.com>)
Список pgsql-sql
Josh Berkus wrote:

>Luis,
>
>  
>
>>Just a question.
>>I'm writing some rules to insert/update some data in my database, and I 
>>gave all the privileges on that view to the user, and only select on the 
>>tables.
>>When that user inserts data using the view, I thought that was user 
>>postgres that will do the rest ! But I got  permission denied on those 
>>tables.
>>The idea was to create a layer, with the views, giving to that user 
>>permission on views to insert and update, and not to tables.
>>Is this possible ?
>>    
>>
>
>I just checked this.  It works fine in 7.2.3.
>
>I think that you are missing a step.  If you want to have an updatable view, 
>then you need to define a Rule for updating it, such as:
>
>kitchen=# create rule update_password as on update to user_password
>kitchen-# do instead update "user" set "password" = NEW."password"
>kitchen-# where user_id = OLD.user_id;
>
>See the online docs, under Server Programming, for how to use the RULES 
>system.
>
>  
>
That's what I already made. The problem is when I do the update, I 
permission denied in all the tables for update and insert. The user 
that's making this operation only have select privilege.
Any way, I'm using version 7.2.1-2 for debian.

Luis Sousa

В списке pgsql-sql по дате отправления:

Предыдущее
От: Luis Sousa
Дата:
Сообщение: Re: Permission on insert rules
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Permission on insert rules