Re: Typed-tables patch broke pg_upgrade

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Typed-tables patch broke pg_upgrade
Дата
Msg-id 1297312298.25615.2.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Typed-tables patch broke pg_upgrade  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Typed-tables patch broke pg_upgrade  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On ons, 2011-02-09 at 18:43 -0500, Tom Lane wrote:
> I find that pg_upgrade fails in HEAD when asked to do a 9.1-to-9.1
> upgrade of the regression database.  It gets to this bit of the
> restore script:
> 
> CREATE TABLE test_tbl2 OF public.test_type2;
> 
> -- For binary upgrade, recreate dropped column.
> UPDATE pg_catalog.pg_attribute
> SET attlen = -1, attalign = 'i', attbyval = false
> WHERE attname = '........pg.dropped.2........'
>   AND attrelid = 'test_tbl2'::pg_catalog.regclass;
> ALTER TABLE ONLY test_tbl2 DROP COLUMN "........pg.dropped.2........";
> 
> and fails with 
> 
> ERROR:  cannot drop column from typed table
> 
> which probably is because test_type2 has a dropped column.

It should call

ALTER TYPE test_type2 DROP ATTRIBUTE xyz CASCADE;

instead.  That will propagate to the table.

I'm not sure though, whether a composite type preserves the dropped
attribute for re-dropping in this case.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Typed-tables patch broke pg_upgrade
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Typed-tables patch broke pg_upgrade