ownership of sequences

Поиск
Список
Период
Сортировка
От Chris
Тема ownership of sequences
Дата
Msg-id 4.3.2.7.2.20021024085531.00aa13b0@pop.iprimus.com.au
обсуждение исходный текст
Ответы Re: ownership of sequences
Список pgsql-general
Hi,

Is there an easy way to alter the owner of a sequence or does it have to be
created by the right user in the first place ?

foo=# create user a with nocreatedb nocreateuser;
foo=# create schema a authorization a;
foo=# create table a.a(id serial, name text);
foo=# set search_path='a';
foo=# \d
           List of relations
  Schema |   Name   |   Type   | Owner
--------+----------+----------+-------
  a      | a        | table    | pgsql
  a      | a_id_seq | sequence | pgsql
(2 rows)

foo=# alter table a owner to a;
foo=# \d
           List of relations
  Schema |   Name   |   Type   | Owner
--------+----------+----------+-------
  a      | a        | table    | a
  a      | a_id_seq | sequence | pgsql
(2 rows)

foo=# \c - a
foo=> insert into a(name) values ('blah');
ERROR:  a_id_seq.nextval: you don't have permissions to set sequence a_id_seq
foo=>


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

Предыдущее
От: "Bruce David"
Дата:
Сообщение: Trigger on 'create table' ?
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Recover data from crashed HD