Re: [7.4] "permissions problem" with pl/pgsql function - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: [7.4] "permissions problem" with pl/pgsql function
Date
Msg-id 400C74E0.4050205@familyhealth.com.au
Whole thread Raw
In response to [7.4] "permissions problem" with pl/pgsql function  ("Marc G. Fournier" <scrappy@hub.org>)
List pgsql-hackers
> 420_test=> select
> dropgeometrycolumn('420_test','lroadline61','roads61_geom');
> ERROR:  permission denied for relation pg_attribute
> CONTEXT:  PL/pgSQL function "dropgeometrycolumn" line 19 at execute statement
> 
> the database was created as:
> 
> CREATE DATABASE <db> WITH OWNER = <owner>
> 
> and I'm connected to the database as the owner ... shouldn't the "system
> tables" also be owned by the owner?

No, you have to have the usecatupd field set to true in your pg_shadow 
row to be able to modify the catalogs.  This is automatically assigned 
to a superuser, not the database owner.  (Otherwise it's trivial to munt 
someone else's database by deleting from pg_database or pg_shadow...)

Chris



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Old binary packages.
Next
From: "Thomas Hallgren"
Date:
Subject: Re: SPI_prepare and error recovery