Re: Controlling access to Sequences

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: Controlling access to Sequences
Дата
Msg-id 20030201234203.GB1300@wallace.ece.rice.edu
обсуждение исходный текст
Ответ на Re: Controlling access to Sequences  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
On Sat, Feb 01, 2003 at 12:39:50AM -0600, Bruno Wolff III wrote:
> On Fri, Jan 31, 2003 at 23:47:27 +1100,
>   Matthew Horoschun <mhoroschun@canprint.com.au> wrote:
> > 
> > Is there any effective method for controlling access to a SEQUENCE? or 
> > should I do something like in the view:
> 
> You can limit access to nextval by only allowing access through a user
> defined function that runs as the definer. If you only want them to use
> the function when doing an insert into a specific table, then I am not
> sure if you can do this easily. At worst you could write a function
> that does the insert.

Define your 'suid_nextval()' as Bruno suggests, then instead of using the
'serial' convience type, define your own that uses your function as the
default, rather than nextval().

Ross


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

Предыдущее
От: pginfo
Дата:
Сообщение: Re: update and IN vs. EXISTS
Следующее
От: Agnieszka Rutkowska
Дата:
Сообщение: extracting constraints from schema