should avoid permission denied for relation pg_attribute - Mailing list pgadmin-support

From Virgil Frum
Subject should avoid permission denied for relation pg_attribute
Date
Msg-id 002c01c5140d$e9b5bfe0$0a02a8c0@VirgilDell
Whole thread Raw
List 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 by date:

Previous
From: Sunburned Surveyor
Date:
Subject: Connection Troubleshooting - Password Problem???
Next
From: Massimo Fidanza
Date:
Subject: Problem compiling pgadmin3 under kdevelop