Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
Дата
Msg-id m2k3vzwouo.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Hi,

Sorry for being late at the party=E2=80=A6 been distracted away=E2=80=A6
=20=20=20=20=20=20=20
Bruce Momjian <bruce@momjian.us> writes:
> On Fri, Jun 22, 2012 at 10:37:10PM -0400, Tom Lane wrote:
>> jeff@pgexperts.com writes:
>> > DROP and CREATE extension appear to work fine, but if you ALTER EXTENS=
ION
>> > postgis SET SCHEMA foo, it leaves a few relations behind.
>>=20
>> What it seems to be leaving behind is indexes ... also relation rowtypes.
>>=20
>> A bit of looking shows that ALTER EXTENSION SET SCHEMA calls
>> AlterObjectNamespace_oid on the table.  AlterObjectNamespace_oid
>> calls AlterRelationNamespaceInternal, and nothing else.  In comparison,
>> ALTER TABLE SET SCHEMA (AlterTableNamespace) calls
>> AlterRelationNamespaceInternal and about four other things.  I'm not
>> sure if this was broken before the last round of refactoring in this
>> area, but for sure it's broken now.

Looking at that code, my theory of how we got there is that in the
submitted extension patch I did only use DEPENDENCY_INTERNAL and Tom
introduced the much better DEPENDENCY_EXTENSION tracking. With the
former, indexes and sequences and constraints where found in the
dependency walking code, but only the main relation is now registered in
the later model.

I need to do some testing about dependency tracking on SERIAL generated
sequences compared to manually created sequences in extension scripts, I
think we track sequences directly only in the manual case.

I think we need to share more code in between
AlterRelationNamespaceInternal and AlterTableNamespace, but I'm not sure
if that's not exactly what =C3=81lvaro did try with his _oid() attempt that
failed.

Regards,
--=20
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

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

Предыдущее
От: Martin Pitt
Дата:
Сообщение: Re: BUG #7532: cannot update to 9.2
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: BUG #7516: PL/Perl crash