Обсуждение: Is there a way to implicitly grant privileges to an implicitly created sequence?

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

Is there a way to implicitly grant privileges to an implicitly created sequence?

От
Brar Piening
Дата:
Hi there,
if I use the datatype serial in a table it implicitly creates a sequence.
If I grant INSERT to a user on this table he still can't insert data as
he doesn't have the right privileges on the implicitly created sequence.
Is this a bug or a feature?
Is there a way to implicitly grant the right privileges to this sequence
wihtout having to know it's name?

Regrards,
Brar Piening


Re: Is there a way to implicitly grant privileges to an implicitly created sequence?

От
Bruno Wolff III
Дата:
On Tue, Feb 22, 2005 at 15:23:23 +0100,
  Brar Piening <brar@gmx.de> wrote:
> Hi there,
> if I use the datatype serial in a table it implicitly creates a sequence.
> If I grant INSERT to a user on this table he still can't insert data as
> he doesn't have the right privileges on the implicitly created sequence.
> Is this a bug or a feature?

I think this is something that will eventually get changed, but for now
you have to live with it.

> Is there a way to implicitly grant the right privileges to this sequence
> wihtout having to know it's name?

There is a function that will return the name of implicit sequences in
version 8.0. However you can't use it directly in a GRANT statement.
If you use scripting to do the table creation, the script could get the
sequence name and execute an appropiate GRANT statement.