Re: BUG #13442: ISBN doesn't always roundtrip with text - Mailing list pgsql-bugs

From Fabien COELHO
Subject Re: BUG #13442: ISBN doesn't always roundtrip with text
Date
Msg-id alpine.DEB.2.10.1507271848230.3538@sto
Whole thread Raw
In response to Re: BUG #13442: ISBN doesn't always roundtrip with text  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-bugs
Hello,

>> After some tests, it seems that an upgrade script cannot be provided,
>> or I missed something.
>>
>> Basically version 1.0 was confusing ISBN & ISBN13, and for upgrading the
>> ISBN type definition must be modified. However, there is no such thing as
>> ALTER TYPE, and trying DROP TYPE/ALTER TYPE is rejected because the type
>> belongs to an extension (hey I know that, this is what is being done!).
>
> You can't test extension upgrade scripts by running the component
> statements at the command line. You have to make an actual dummy upgrade
> script and test it via "alter extension ... update ...".

Yep... but I actually tried that.

> When executed in that context, they are exempted from the rule you are
> running into.

With DROP TYPE isbn:

  # ALTER EXTENSION isn UPDATE;
  ERROR:  cannot drop type isbn because other objects depend on it
  DETAIL:  extension isn depends on type isbn
  HINT:  Use DROP ... CASCADE to drop the dependent objects too.

With DROP TYPE isbn CASCADE:

  # ALTER EXTENSION isn UPDATE;
  ERROR:  cannot drop extension "isn" because it is being modified

> (Or maybe there is another way that I don't know of).
> But I wonder what will happen when you try to drop a type which is in use?

Probably it should drop the dependent objects recursively, but as isn
depends on isbn we do not want to drop the extension while upgrading it.

--
Fabien.

pgsql-bugs by date:

Previous
From: Jeff Janes
Date:
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
Next
From: Heikki Linnakangas
Date:
Subject: Re: Memory leak in XLOG reader facility when decoding records (caused by WAL refactoring)