should avoid permission denied for relation pg_attribute

Поиск
Список
Период
Сортировка
От Virgil Frum
Тема should avoid permission denied for relation pg_attribute
Дата
Msg-id 002c01c5140d$e9b5bfe0$0a02a8c0@VirgilDell
обсуждение исходный текст
Список pgadmin-support
I'm connected to a postgresql server as non-privileged user. If I want to 
rename a column which has length field modifiable then SQL looks like:

ALTER TABLE tablename RENAME columnname  TO newcolumnname;
UPDATE pg_attribute  SET atttypmod=132WHERE attrelid=21373::oid AND attnum=6;

even if length value wasn't changed. To successfuly execute that "UPDATE 
pg_attribute" some privileges are needed to avoid "permission denied for 
relation pg_attribute" but I don't have because I'm connected as a 
non-privileged user.

You should store user privileges at connection time and check where is 
needed if user has enough privileges to do expected operation. In above case 
to gray out length field. If it's to complicated, at least check if length 
field was changed and generate "UPDATE pg_attribute" only if needed.

A hint for "permission denied..." would be welcomed.

Regards,
Virgil



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

Предыдущее
От: Sunburned Surveyor
Дата:
Сообщение: Connection Troubleshooting - Password Problem???
Следующее
От: Massimo Fidanza
Дата:
Сообщение: Problem compiling pgadmin3 under kdevelop