should avoid permission denied for relation pg_attribute

From: "Virgil Frum" <virgil(at)livius(dot)net>
To: <pgadmin-support(at)postgresql(dot)org>
Subject: should avoid permission denied for relation pg_attribute
Date: 2005-02-16 09:57:22
Message-ID: 002c01c5140d$e9b5bfe0$0a02a8c0@VirgilDell
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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=132
WHERE 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

Browse pgadmin-support by date

  From Date Subject
Next Message Massimo Fidanza 2005-02-17 18:58:27 Problem compiling pgadmin3 under kdevelop
Previous Message Sunburned Surveyor 2005-02-16 00:39:22 Connection Troubleshooting - Password Problem???