RE: Updating pg_attribute - Permission denied

From: "Trewern, Ben" <Ben(dot)Trewern(at)mowlem(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: RE: Updating pg_attribute - Permission denied
Date: 2000-10-23 08:33:39
Message-ID: 996802F75C3CD411B424001083FA445B0594E6@CET_PONXX_FP001
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Looks like I have turned off usecatupd in pg_shadow. Doh! Was mucking
around with permissions some time ago but not had any trouble up till now.

Any ideas how to switch it back? Update pg_shadow SET usecatupd ..... gives
me Permission denied!!!

Ben.

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: 22 October 2000 04:08
> To: Trewern, Ben
> Cc: 'pgsql-general(at)postgresql(dot)org'
> Subject: Re: [GENERAL] Updating pg_attribute - Permission denied
>
>
> "Trewern, Ben" <Ben(dot)Trewern(at)mowlem(dot)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
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Pilsl 2000-10-23 09:35:25 blobs dont rollback ?
Previous Message Sungchul Park 2000-10-23 02:04:41 Re: duplicate key ? (fwd)