Re: Fixing invalid owners on pg_toast tables in 8.3.5 - Mailing list pgsql-general

From Tom Lane
Subject Re: Fixing invalid owners on pg_toast tables in 8.3.5
Date
Msg-id 27254.1235237450@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixing invalid owners on pg_toast tables in 8.3.5  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I wrote:
> [ scratches head... ]  That example fails to misbehave for me in 8.3.6,

Oh, wait, you omitted a step from the example: the ALTER has to be done
as somebody other than the table owner (eg a superuser, else you'd not
have the needed permissions).

regression=# create user a;
CREATE ROLE
regression=# \c - a
psql (8.4devel)
You are now connected to database "regression" as user "a".
regression=> create table toaster (
  bread varchar(7000));
CREATE TABLE
regression=> select typowner from pg_type join pg_class on (typname=relname) where
pg_class.oid in (select reltoastrelid from pg_class where
relname='toaster');
 typowner
----------
    63977
(1 row)

regression=> \c - postgres
psql (8.4devel)
You are now connected to database "regression" as user "postgres".
regression=# alter table toaster ALTER bread type varchar(9000);
ALTER TABLE
regression=# select typowner from pg_type join pg_class on (typname=relname) where
pg_class.oid in (select reltoastrelid from pg_class where
relname='toaster');
 typowner
----------
       10
(1 row)

Yeah, that's a bug.  It probably hasn't got anything to do with the
other toast-table weirdnesses we've heard about, but it's a bug.

            regards, tom lane

pgsql-general by date:

Previous
From: Will Harrower
Date:
Subject: Pointers in custom types
Next
From: Tom Lane
Date:
Subject: Re: Pointers in custom types