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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Brar Piening <brar(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way to implicitly grant privileges to an implicitly created sequence?
Date: 2005-02-22 14:57:22
Message-ID: 20050222145722.GF22550@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 22, 2005 at 15:23:23 +0100,
Brar Piening <brar(at)gmx(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stefan.Ardeleanu 2005-02-22 15:06:27 FW: execute dynamic strings. need help.
Previous Message Sim Zacks 2005-02-22 14:41:58 Re: FOR vs Cursors