Re: Updating pg_attribute - Permission denied

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Updating pg_attribute - Permission denied
Дата
Msg-id 2446.972184085@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Updating pg_attribute - Permission denied  ("Trewern, Ben" <Ben.Trewern@mowlem.com>)
Список pgsql-general
"Trewern, Ben" <Ben.Trewern@mowlem.com> writes:
> I was trying to update attnotnull = 't' in the pg_attribute to add Not Null
> constraint to a table.  It gave me a Permission denied.
> Is this standard? Am I not allowed to change system catalogues (I am using
> the postgres superuser!)

I don't believe it --- are you *sure* you were superuser?  Or perhaps
you'd turned off pg_shadow's usecatupd for yourself?

I get this behavior:

play=> update pg_attribute set attnotnull = 't' where attrelid =  334893 and
play-> attname = 'f1';
ERROR:  pg_attribute: Permission denied.
play=> \c - postgres
You are now connected as new user postgres.
play=# update pg_attribute set attnotnull = 't' where attrelid =  334893 and
play-# attname = 'f1';
UPDATE 1
play=#

> Or can you only change attnotnull to false i.e. remove a not null
> constraint?  I suppose this would make some kind of sense, as there
> could already be Nulls in the field.

It's up to you to worry about that sort of consistency issue if you
reach in and hack pg_attribute directly.  Certainly the permission
check is not concerned with it.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Out of memory errors with mod_perl
Следующее
От: Bo Berkhaut
Дата:
Сообщение: please help me with arrays