Re: serial- sequence priveleges

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: serial- sequence priveleges
Дата
Msg-id 4F6350C2.6060408@gmail.com
обсуждение исходный текст
Ответ на serial- sequence priveleges  (salah jubeh <s_jubeh@yahoo.com>)
Список pgsql-general
On 03/16/2012 07:06 AM, salah jubeh wrote:
> Hello,
>
> When creating a serial, a sequence is created automatically.
>
> CREATE TABLEtablename  (
>      colname  SERIAL
> );
>
> CREATE SEQUENCE tablename_colname_seq;
> CREATE TABLE tablename (
>      colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
> );
> ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname;

The OWNED BY is for dependency tracking not privileges:

http://www.postgresql.org/docs/9.1/interactive/sql-altersequence.html
OWNED BY table.column
OWNED BY NONE
The OWNED BY option causes the sequence to be associated with a specific
table column, such that if that column (or its whole table) is dropped,
the sequence will be automatically dropped as well. If specified, this
association replaces any previously specified association for the
sequence. The specified table must have the same owner and be in the
same schema as the sequence. Specifying OWNED BY NONE removes any
existing association, making the sequence "free-standing".



>
>
> Should not a proper permissions based on the table privileges added to
> the sequence ?. For example, when a table has INSERT, UPDATE permissions
> on the table to a certain user, this should be taken into account.
>
> Regards
>
>


--
Adrian Klaver
adrian.klaver@gmail.com

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

Предыдущее
От: Lonni J Friedman
Дата:
Сообщение: Re: how to measure wal_buffer usage
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: how to measure wal_buffer usage