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.1507272252090.3538@sto
Whole thread Raw
In response to Re: BUG #13442: ISBN doesn't always roundtrip with text  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: BUG #13442: ISBN doesn't always roundtrip with text
List pgsql-bugs
> If I understand this correctly, you need to ALTER EXTENSION .. DROP
> (which removes the type from the extension), then drop the type, create
> it fresh, then ALTER EXTENSION ADD to put it back.

After some testing with that, I have a conundrum: I would like the update
to *fail* if the user actually uses the isbn type so as not to harm data.

However, when the script is at:

   DROP TYPE isbn;

It fails, because the isbn_in & out functions depends on it.
If you try:

   DROP FUNCTION isbn_in(cstring);

It fails, because the isbn type depends on it. Sure.

The usual exit strategy is:

   DROP TYPE isbn CASCADE;

Which works fine... but as a side effect silently remove ISBN columns that
may exist in user table. I do not think it is a good idea for an extension
update script to do that to a librarian:-)

Bar any idea around this issue, I think that an extension upgrade script
is really unadvisable, and the user should do a dump data, drop extension,
create extension, restore data.

--
Fabien.

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: Segfault in pg_stat_activity
Next
From: Tom Lane
Date:
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text